Yes - see the pipe form of open. You need the bunzip2 executable installed for that:
my $cmd = sprintf 'bunzip2 -cd "%s"', $filename; open my $fh, "$cmd |" or die "Couldn't launch [$cmd]: $!"; binmode $fh; print while <$fh>;
Update: Fixed missing filename argument, spotted by AnomalousMonk
In reply to Re: Alternative to IO::Uncompress::Bunzip2
by Corion
in thread Alternative to IO::Uncompress::Bunzip2
by prescott2006
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |