walkingthecow has asked for the wisdom of the Perl Monks concerning the following question:

I get the following error when trying to build anything in CPAN: "Undefined subroutine &Compress::Zlib::gzopen" I am wondering, is there any possible way, without editing CPAN.pm, to tell CPAN to use gzip command rather than gzip functions in Compress::Zlib? In the CPAN.pm I see this:
if ($CPAN::META->has_inst("Compress::Zlib")) { my $gz = Compress::Zlib::gzopen($file,"rb") or die "Could not gzopen $file"; $ret = bless {GZ => $gz}, $class; } else { my $pipe = "$CPAN::Config->{gzip} --decompress --stdout $file |"; my $fh = FileHandle->new($pipe) or die "Could not pipe[$pipe]: $!" +; binmode $fh; $ret = bless {FH => $fh}, $class; } $ret;
Which tells me that it sees if Compression::Zlib is installed, and if so it uses functions from there, but if not it will use gzip as configured in CPAN config file. In MyConfig.pm I have gzip's path, so I'd rather use it. I do not have root access on this machine, so I need ways to figure this out without root access.

Replies are listed 'Best First'.
Re: Undefined subroutine &Compress::Zlib::gzopen
by Anonymous Monk on Apr 02, 2010 at 23:23 UTC