Archive::Zip use?

G

Geoff Cox

Hello,

With excellent help from this group I have been able to use the
following code to change a zip file to a doc file with the same name
as the zip file ...

would now like to do the reverse of this in a slightly different way
... I have say 20 doc files in a folder which I would like to zip and
name as doc1.zip, doc2.zip etc ... I am guessing that the code will
not be too different from that below but would appreciate some help on
which Archive::Zip method would be appropriate here...

Thanks

Geoff


use warnings;
use strict;

use File::Find;
use Archive::Zip;

my $dir = 'c:/atemp9';

find( sub {
( my $name = $_ ) =~ s/\.zip$/.doc/i or return;
my $zip = Archive::Zip->new( $_ );
$zip->extractMember( ($zip->memberNames)[ 0 ], $name );
unlink $_ or warn "Cannot delete $_: $!";
}, $dir );
 
J

James Willmore

With excellent help from this group I have been able to use the
following code to change a zip file to a doc file with the same name
as the zip file ...

would now like to do the reverse of this in a slightly different way
.. I have say 20 doc files in a folder which I would like to zip and
name as doc1.zip, doc2.zip etc ... I am guessing that the code will
not be too different from that below but would appreciate some help
on which Archive::Zip method would be appropriate here...
<snip>

Have you consulted the documentation?
The command is -
perldoc Archive::Zip

-or-

http://search.cpan.org/~nedkonz/Archive-Zip-1.06/lib/Archive/Zip/FAQ.pod

HTH

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
Putt's Law: Technology is dominated by two types of people:
Those who understand what they do not manage. Those who manage
what they do not understand.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top