heigold1 has asked for the wisdom of the Perl Monks concerning the following question:
#!/opt/ActivePerl-5.6/bin/perl # Archive::Zip is available for ActiveState perl use strict; use warnings; use Archive::Zip qw ( :ERROR_CODES :CONSTANTS ); my $zip = Archive::Zip->new(); my @files = glob("*.txt"); foreach (@files) { my $member = $zip->addFile($_); die "Cannot add $_ to zip!" unless $member; } ############################## ### Right here is the addDirectory ### ############################## $zip->addDirectory("dir1"); $zip->writeToFileNamed( "zipfile.zip" );
Edit: g0n - code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $zip->addDirectory isn't doing anything.
by starX (Chaplain) on Jun 21, 2007 at 21:04 UTC | |
|
Re: $zip->addDirectory isn't doing anything.
by FunkyMonk (Bishop) on Jun 21, 2007 at 20:31 UTC | |
by Anonymous Monk on Jun 21, 2007 at 20:51 UTC | |
by ysth (Canon) on Jun 22, 2007 at 00:43 UTC | |
|
Re: $zip->addDirectory isn't doing anything.
by Anonymous Monk on Jun 22, 2007 at 05:22 UTC |