Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: problem with Archive::Zip

by almut (Canon)
on Aug 09, 2010 at 12:01 UTC ( [id://853792]=note: print w/replies, xml ) Need Help??


in reply to problem with Archive::Zip

My guess would be that the $zip->addFile($renamed_file) failed and returned undef...  (so you're then trying to call desiredCompressionLevel(0) on this undefined value)

Replies are listed 'Best First'.
Re^2: problem with Archive::Zip
by jpfisher (Initiate) on Feb 28, 2019 at 18:59 UTC

    This problem also wasted a day of my time, because I am a very occasional user of perl. I hope to save someone else the trouble.

    This line failed on Win32 with the error quoted above:

    $zip->addFile("$workPath\\shared\\base.dll", "$packageName/base.dll") or die "$! add file failed \n";

    The actual problem was the $workPath was wrong, making base.dll unavailable, but the 'or die' which I added to debug, didn't catch the missing file error. Frankly, once I followed the exact suggestion to use -e -r -f to check the filespec, the root cause was instantly revealed. The following revealed the error:

     if (( -f $$workPath\\shared\\base.dll) && ( -r $workPath\\shared\\base.dll)) { print "good\n";}else{ die " blah blah blah\n";}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://853792]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-19 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found