X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FEncode%2Fbin%2Funidump;h=a9484d0625fd6f6cf99460ffdd84bc4048d3941b;hb=f2a2953c25503948c9a5e44b5ee7fe84a7da6b46;hp=0e2a9628948af3248e9749fe68e3b0a818465714;hpb=735b7a62d039909fa334af8e05d4788f54c2c65a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/Encode/bin/unidump b/ext/Encode/bin/unidump index 0e2a962..a9484d0 100644 --- a/ext/Encode/bin/unidump +++ b/ext/Encode/bin/unidump @@ -32,8 +32,7 @@ sub do_perl{ use utf8; $linebuf .= Encode::decode($Opt{f}, $_); while($linebuf){ - my $chr = render_p(substr($linebuf, 0, 1)); - substr($linebuf, 0, 1) = ''; + my $chr = render_p(substr($linebuf, 0, 1, '')); length($outbuf) + length($chr) > $CPL and print_P(); $outbuf .= $chr; } @@ -41,8 +40,7 @@ sub do_perl{ $outbuf and print print_P(";"); }else{ while($string){ - my $chr = render_p(substr($string, 0, 1)); - substr($string, 0, 1) = ''; + my $chr = render_p(substr($string, 0, 1, '')); length($outbuf) + length($chr) > $CPL and print_P(); $outbuf .= $chr; } @@ -78,18 +76,16 @@ sub do_dump{ use utf8; $linebuf .= Encode::decode($Opt{f}, $_); while (length($linebuf) > $CPL){ - my $chunk = substr($linebuf, 0, $CPL); + my $chunk = substr($linebuf, 0, $CPL, ''); print_C($chunk, $linenum++); - substr($linebuf, 0, $CPL) = ''; $Opt{H} and $linenum % $Opt{H} == $CPL-1 and print_S(); } } $linebuf and print_C($linebuf); }else{ while ($string){ - my $chunk = substr($string, 0, $CPL); + my $chunk = substr($string, 0, $CPL, ''); print_C($chunk, $linenum++); - substr($string,0, $CPL) = ''; $Opt{H} and $linenum % $Opt{H} == $CPL-1 and print_S(); } }