
rovf
Veteran
Sep 9, 2011, 4:22 AM
Post #16 of 23
(920 views)
|
First a few things which are odd in your program: (1) Unless you have written your own, custom version, of "file::path", use file::path should be instead (note that File::Path is a standard module). I was surprised that Perl doesn't issue any error message, since module names *are* sensitive. Still, I would correct this. (2) You use double slashes to separate the components of the path. I know that this doesn't harm on Unix, but I don't know about the side effects within Perl. In particular, when you run on Windows, and one of the functions you are calling decide to translate the path into Windows syntax and make to backslashes out of it, this will result in an illegal file name, so I would fix this too. And indeed: (3) From the Archive::Zip docs for addFile:
If the name given does not represent a readable plain file or symbolic link, undef will be returned. $fileName must be in the format required for the local file system. So, you neither supply the filenames in the required format, nor do you check for the return code.
|