Hi. I am having trouble w/ IO::Zlib on WinXP ActiveState 5.8.
The following code spits out a few hundred bytes, garbled, then terminates early (no error). The .gz file is known to be uncorrupted -- and I can extract it successfully with WinZip etc. Is this a binmode issue? If so, how do I set binary mode on the filehandle? Or, what?
Thanks!
rkg
use strict;
$|++;
use IO::Zlib;
use Data::Dumper;
my $fname = 'xxxxx-access_log.7.gz';
my $fhin = IO::Zlib->new($fname, 'rB') or die $!;
die "bad file handle" unless $fhin->can('getline');
while (defined(my $line = $fhin->getline())) {
print "$line\n";
}