in reply to Reading contents of a zip file without opening it
I recommend Archive::Zip. It's pretty straightforward and capable once you get the concept of the way it returns zipped archive members as objects which you then call other methods to read or manipulate. For example (from the same project):#!/usr/bin/perl -w use strict; use Archive::Zip; my $zfile = 'somefile.zip'; my $zipobj = Archive::Zip->new() or die "Can't create zip object\n"; if ($error = $zipobj->read($zfile) ) { die "Can't read $zfile\n"; } my @file_names = $zipobj->memberNames();
Cheers. Hope this helps. Davidmy @file_objs = $zipobj->members(); for my $file_obj (@file_objs) { my $file_txt = $file_obj->contents(); # etc. etc. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading contents of a zip file without opening it
by Anonymous Monk on Dec 30, 2015 at 06:53 UTC |