X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FEncode%2Fbin%2Funidump;h=a9484d0625fd6f6cf99460ffdd84bc4048d3941b;hb=80a5d8e74b5512d4ab704d0e83466ae41247ce55;hp=0e2a9628948af3248e9749fe68e3b0a818465714;hpb=004283b80f6094bb85aba6f48a74e3c5c34ea24f;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(); } }