X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=ZPL2pbm.pl;h=796b721e74586c26e068889acf49f78151e4df2f;hb=287b151b7b4ddd9d5a8f47c2f84c71c3e3804cf7;hp=e439ae49475f4587c96b48f23e0f02fd8212bd11;hpb=19ea357698992dfea94dfc919c6efe22917b4a7c;p=Printer-Zebra.git diff --git a/ZPL2pbm.pl b/ZPL2pbm.pl index e439ae4..796b721 100755 --- a/ZPL2pbm.pl +++ b/ZPL2pbm.pl @@ -31,12 +31,11 @@ while( $line ) { warn "# ~DG$1 => [$name] t=$t w=$w\n"; - my $data; - read $in, $data, $t; + my $data = <$in>; my $out; # ZPL decompress - my $repeat = 1; + my $repeat = 0; foreach my $p ( 0 .. length($data) - 1 ) { my $c = substr($data,$p,1); if ( $c eq ',' ) { @@ -51,7 +50,7 @@ while( $line ) { $out .= "1" x $l; } elsif ( $c eq ':' ) { $out .= length($out) > $w ? substr($out,-$w*2) : "00" x $w; - warn "# $p :\n"; + warn "# $p repeat last line\n"; } elsif ( $c eq 'z' ) { $repeat += 400; } elsif ( $c ge 'g' && $c le 'y' ) {