Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
If I want to find a particular file in a zip file, I am doing the following, but it does not seem to detect the file even though the file exists.
my $file = "test.txt"; $zip1 = Archive::Zip->new( $myZipFile ); @files = $zip1->memberNames(); #this does not return any result..even though there are two files in t +he archive called test.txt @files = $zip1->membersMatching( '.*$file' ); print "this is the number of members matching $file : $#files \n\n"; $file->extractToFileNamed($fileToExtract) == AZ_OK or die "Unable to extract data file $! .";
What seems to be the error? Is there another way of finding a file I am looking for in a Zip and extracting it to a temp file for reading? Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: finding file in a zip file
by Paladin (Vicar) on Jan 31, 2005 at 19:17 UTC | |
|
Re: finding file in a zip file
by samizdat (Vicar) on Jan 31, 2005 at 19:12 UTC |