Well, I suppose I've missed a subtlety along the way here. I have two
directories:
/path/to/existing/directory/foo/
/path/to/existing/directory/bar/
And I want to archive these two directories into a zip file named archive.zip.
Here's what I did, using the synopsis of Archive::Zip in CPAN as a guide:
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
my $zip = Archive::Zip->new();
my $super_path = "/path/to/existing/directory";
my $dir_member;
$dir_member = $zip->addDirectory( "$super_path/foo/" ); # what should I do
with $dir_member? anything?
$dir_member = $zip->addDirectory( "$super_path/bar/" );
# Save the Zip file
unless ( $zip->writeToFileNamed("$super_path/archive.zip") == AZ_OK ) {
die 'write error';
}
After executing, the archive.zip file contains basically just the two directory
names. (source directories foo/ and bar/ are definitely populated~)
What boneheaded mistake have I made this time? I suspect I should do something
with $dir_member, but it's not apparent to me.
Thanks,
Chap
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/