Subject: | gzreadline() changed behaviour in 2.005 regarding $/ |
Hi,
This was first reported by Peter Baumann in Debian bug #435656. See
http://bugs.debian.org/435656
It is all about the Compress::Zlib module.
The problem is that in version 1.42, gzreadline() uses "\n" for record
separator no mater what $/ is set, but in versions 2.005, gzreadline
uses IO::Compress::Base::getline, which does different things depending
on $/.
The new version breaks programs and modules that depend on the old
behaviour of gzreadline.
The patch attached restores the old behaviour of
Compress::Zlib::gzFile::gzreadline. Please consider applying.
<rant>
I understand that $/-dependant getline is better overall, but this is
why we have IO::Uncompress::* (implemented in IO::Compress::Base) - new
modules can introduce new behaviour just fine. Compress::Zlib, however
should not change its behaviour, because it would break software that
depends on that.
</rant>
Best regards,
dam
Subject: | 02_restore-Compress::Zlib::gzFile::gzreadline-record-separator-behaviour.patch |
Index: libcompress-zlib-perl/lib/Compress/Zlib.pm
===================================================================
--- libcompress-zlib-perl.orig/lib/Compress/Zlib.pm 2007-08-04 07:45:33.000000000 +0300
+++ libcompress-zlib-perl/lib/Compress/Zlib.pm 2007-08-04 07:46:12.000000000 +0300
@@ -180,7 +180,10 @@
my $self = shift ;
my $gz = $self->[0] ;
- $_[0] = $gz->getline() ;
+ {
+ $/ = "\n";
+ $_[0] = $gz->getline() ;
+ }
_save_gzerr($gz, 1);
return defined $_[0] ? length $_[0] : 0 ;
}