use Archive::Tar; # using the cli utility gunzip # -c causes the file to be 'cat'ed open F, "gunzip -c $filename |"; my $tar = Archive::Tar->new(*F); #### use Archive::Tar; # using the cli utility compress # -c causes the file to be 'cat'ed open F, "uncompress -c $filename |"; # or use # open F, "zcat -c $filename |"; my $tar = Archive::Tar->new(*F);