I have a short program that extracts text file from a .gz archive using
Compress::ZLIB.
Using "while ($gz->gzreadline($line) > 0)" I read each line, potential
process it, then write the line to a new file.

If print the length of $line it show a length of the text plus two
characters for 0D and 0A.
When I use:

print  "length=".length($line) ."\n";
my @a = split //,$line;
foreach my $x (@a){
   print $x . " " . ord($x) ."\n";
}

I see exactly what I expect.

However when I print the line to a file and view the file using two
different Hex editors, I see that the line terminates with "0D 0D 0A". I
am not using chomp, chop, or adding any characters to the variable
during the print.

When I again use Perl to read the new file and use the sample code above
to analyze the input line, Perl again shows me the data I would expect
to see. That is a text line ending in just "0D 0A".

When check the length of the input string it matches that number of what
was supplied to the print command.

Is there some feature I am missing here or is this a bug?
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to