Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   where is the mistake?! (http://www.velocityreviews.com/forums/t883052-where-is-the-mistake.html)

Geoff Cox 10-12-2003 08:33 AM

where is the mistake?!
 
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 );

Gunnar Hjalmarsson 10-14-2003 09:14 PM

Re: where is the mistake?!
 
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


Eric Schwartz 10-14-2003 09:32 PM

Re: where is the mistake?!
 
Geoff Cox <geoff.cox@blueyonder.co.uk> 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.


All times are GMT. The time now is 12:16 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.