#!/usr/bin/perl use Archive::Tar; use IO::Compress::Gzip qw(gzip $GzipError); use IO::Uncompress::Gunzip qw(gunzip $GunzipError); use IO::Uncompress::Unzip qw(unzip $UnzipError); use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError); my $tar = Archive::Tar->new; #my $inner; $tar->read('test.tar'); $inner = $tar->get_content('1.zip'); #$tar->extract_file('1.zip', \$inner); anyuncompress \$inner, \$txt, Name => '3.txt'; #unzip \$inner, \$txt, Name => 'ReadMe.txt'; #works #gunzip 'test.gz', $txt; #doesn't work print "$txt\n";