in reply to $zip->addFile not working.
The error message indicates that $zip, not $fileWithPath, is your problem (that being the object you are attempting to call the method on, while $fileWithPath is the parameter you're trying to pass to the method). Without looking at the Archive::Zip documentation, I'd suggest changing your earlier code to
my $zip = Archive::Zip->new() or die "Unable to create archive: $@\n"
which should tell you what went wrong, assuming Archive::Zip::new is kind enough to set the error message when it fails.
|
|---|