Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: changing filenames using Archive::Zip

by grep (Monsignor)
on May 17, 2009 at 21:58 UTC ( [id://764558]=note: print w/replies, xml ) Need Help??


in reply to changing filenames using Archive::Zip

Use the members method to get each of the zip members one at a time. Then use extractMember to extract and rename.
use warnings; use strict; use Archive::Zip; my $zip = Archive::Zip->new('foo.zip'); my $file_counter = 0; foreach my $member ( $zip->members ) { my $file_name = $member->fileName; my $extracted_file_name = 'file-'. $file_counter++ . '.foo'; print "extracting $file_name as $extracted_file_name\n"; $zip->extractMember($member, $extracted_file_name); }
grep
One dead unjugged rabbit fish later...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://764558]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-20 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found