in reply to Inefficient code?
use strict ; use warnings ; use Compress::Zlib ; die "Usage: gzcat file...\n" unless @ARGV ; my $file ; foreach $file (@ARGV) { my $buffer ; my $gz = gzopen($file, "rb") or die "Cannot open $file: $gzerrno\n" ; print $buffer while $gz->gzread($buffer) > 0 ; die "Error reading from $file: $gzerrno" . ($gzerrno+0) . "\n" + if $gzerrno != Z_STREAM_END ; $gz->gzclose() ; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Inefficient code?
by Anonymous Monk on Apr 23, 2001 at 10:42 UTC |