Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > where is the mistake?!

Reply
Thread Tools

where is the mistake?!

 
 
Geoff Cox
Guest
Posts: n/a
 
      10-12-2003
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 );
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      10-14-2003
Geoff Cox wrote:
> 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?

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

 
Reply With Quote
 
 
 
 
Eric Schwartz
Guest
Posts: n/a
 
      10-14-2003
Geoff Cox <(E-Mail Removed)> writes:
> 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
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments