walkingthecow has asked for the wisdom of the Perl Monks concerning the following question:
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.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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Undefined subroutine &Compress::Zlib::gzopen
by Anonymous Monk on Apr 02, 2010 at 23:23 UTC |