What is your preferred method for reading through the contents of zipped directories with Perl ?
+5
A:
There are several modules on CPAN for working with various archive formats (zip, tar, etc.), the one you're probably after is Archive::Zip.
Kyle Burton
2008-09-25 17:19:06
When you post links to (search.)CPAN, please make sure you point to the author and version agnostic URL so it always points to the latest version of the module. In this case, that would be: http://search.cpan.org/perldoc?Archive::Zip
tsee
2008-09-25 17:52:29
+1
A:
If you want the contents of a .tar.gz archive
open(DIR_LISTING, "gzip -dc concert25.tgz | tar -tf -|") || die;
while (<DIR_LISTING>) {
print;
}
close (DIR_LISTING);
David Nehme
2008-09-25 18:32:40
+2
A:
Archive::Zip
require Archive::Zip;
my $zip = Archive::Zip->new($somefile);
for my $m ($zip->memberNames()) {
print $m;
}
Jeff MacDonald
2008-09-25 20:22:49