use IO::Uncompress::Gunzip qw(gunzip $GunzipError); my $output; my $status = gunzip $ARGV[0] => \$output, Strict => 1 or die "Failed!"; print $GunzipError; print $output;