Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: changing filenames using Archive::Zip

by grep (Monsignor)
on May 17, 2009 at 21:58 UTC ( #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...


Comment on Re: changing filenames using Archive::Zip
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2014-12-27 00:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls