in reply to Re: Explain Archive::Zip to me please?
in thread Explain Archive::Zip to me please?
my $zip = Archive::Zip->new( 'browser.jar' ) || die "$!"; # extract what you want my $file = "content/browser/browser.js"; $zip->extractMember($file); # Edit the file as necessary, # which is at ./content/browser/browser.js # now add it back $zip->removeMember($file); $zip->addFile($file); $zip->overwrite();
The extractMember function actually does extract a tree, as in, it extracts whatever directories are necessary to mirror that one file and its enclosing directories. So the file is there in the current working directory, inside the portion of the tree where it was located in the zip file.
($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print
|
|---|