On Aug 2, 9:12 pm, [EMAIL PROTECTED] (John W. Krahn) wrote:

>    open IN, '-|', "$GZCAT $file_location/$input" or die "Cannot read $input\n 
> $!";

On recent Perl you can avoid the need for your command to be parsed:

   open IN, '-|', $GZCAT, "$file_location/$input" or die "Cannot read
$input\n $!";

This is more elegant and also does not get confused by shell meta-
characters in the filename.

However there are also many ways on CPAN to read gzip compressed files
via zlib without the need for a separate process.  The most modern of
these is the IO-layer approach.

use PerlIO::gzip;
open IN, '<:gzip', "$file_location/$input" or die "Cannot read $input
\n $!";


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to