in reply to running shell commands from within perl

Run the command in a pipe. Something like this:
open (my $in, '-|', 'gzip -dc compressed_file.gz') || die "Can't run gzip: $!"; while (<$in>) { # Process the line of output } close $in;
The use of gzip is only an example.