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 );
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 );