2008-09-25 51 views

回答

6

CPAN上有幾個模塊用於處理各種存檔格式(zip,tar等),您可能使用的格式爲Archive::Zip

+1

當您將鏈接發佈到(搜索。)CPAN時,請確保您指向作者和版本不可知的URL,以便始終指向模塊的最新版本。在這種情況下,這將是:http://search.cpan.org/perldoc?Archive::Zip – tsee 2008-09-25 17:52:29

1

如果你想是.tar.gz歸檔

open(DIR_LISTING, "gzip -dc concert25.tgz | tar -tf -|") || die; 
while (<DIR_LISTING>) { 
    print; 
} 
close (DIR_LISTING); 
4

存檔::內容郵編

require Archive::Zip; 
my $zip = Archive::Zip->new($somefile); 
for($zip->memberNames()) { 
    print "$_\n"; 
}