I think $zip->addFile() needs the complete path, not just the filename. So try this:
# outside of loop: $dir = "C:/ReportExtract/Director"; # ... # inside your foreach loop: if (-e "$dir/$temp" ) { unless ( $zip->addFile("$dir/$temp") ) { print "Error: failed to add $dir/$temp to archive.\n"; } } else { print "Error: $dir/$temp does not exist!\n"; }
This also adds error checking, so you can see if it's doing the right thing as it runs.
In reply to Re^3: Archive::Zip Simple Issue
by scorpio17
in thread Archive::Zip Simple Issue
by drodinthe559
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |