5 use IO::Uncompress::Gunzip qw($GunzipError);
7 die "Usage: gzgrep pattern [file...]\n"
13 @ARGV = '-' unless @ARGV ;
15 foreach $file (@ARGV) {
16 my $gz = new IO::Uncompress::Gunzip $file
17 or die "Cannot uncompress $file: $GunzipError\n" ;
23 die "Error reading from $file: $GunzipError\n"
28 foreach $file (@ARGV) {
29 my $gz = gzopen($file, "rb")
30 or die "Cannot open $file: $gzerrno\n" ;
32 while ($gz->gzreadline($_) > 0) {
36 die "Error reading from $file: $gzerrno\n"
37 if $gzerrno != Z_STREAM_END ;