use IO::Uncompress::Gunzip (); my $in = IO::Uncompress::Gunzip->new('tst.gz', MultiStream=>1 ) or die "$IO::Uncompress::Gunzip::GunzipError"; print while <$in>; close $in;