where is the mistake?!

G

Geoff Cox

Hello,

I have a directory with 20 MS Word doc files in it and wish to create
a separate zip file for each doc file. The names to be doc1.zip,
doc2.zip, etc

Is the code below anywhere near?!

Cheers

Geoff


use warnings;
use strict;

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

my $dir = 'd:/a-keep8/perl/test/business-location';

find( sub {
( my $name = $_ ) or return;
for (my $n=1;$n<21;$n++) {
my $zip = Archive::Zip->new( $_ );
$zip->writeToFileName(my $business-doc$n);
}
}, $dir );
 
G

Gunnar Hjalmarsson

Geoff said:
I have a directory with 20 MS Word doc files in it and wish to
create a separate zip file for each doc file. The names to be
doc1.zip, doc2.zip, etc

Is the code below anywhere near?!

Err.. Ever thought of learning how to debug your Perl programs
yourself rather than asking the readers of this group to do it for you?
 
E

Eric Schwartz

Geoff Cox said:
I have a directory with 20 MS Word doc files in it and wish to create
a separate zip file for each doc file. The names to be doc1.zip,
doc2.zip, etc

Is the code below anywhere near?!

What happened when you tried it? What did you expect to happen? What
don't you understand about the difference?

Contrary to what some people seem to think, we're happy to help out
here, but we do require that you do a little bit of effort yourself.
Posting code is a Good Thing(tm), but it's only the first step. Read
the Posting Guidelines Tad McClellan posts to this group regularly,
and you'll probably want to spend some time with ESR's "How to ask
Questions the Smart Way" at
<URL:http://www.catb.org/~esr/faqs/smart-questions.html>.

-=Eric
 

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top