in reply to zcat pipe gives "gzip: stdout: Broken pipe" error

I haven't tested it, but there is PerlIO::gzip, which could allow you to do something like this:

use PerlIO::gzip; use Carp; ... my $iolayer = ''; if($filename =~ /\.gz$/i) { $iolayer = ':gzip'; } open($ifh, '<' . $iolayer, $filename) or croak("$!"); ... # Process data while((my $line = <$ifh>)) { chomp $line; if($line =~ /bla/) { doBla($line); } else { doBlub($line); } } ... close $ifh;

No pipes, no external program to worry about, just basic IO stuff.

PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
Also check out my sisters artwork and my weekly webcomics