Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Archive::Zip Error

by Anonymous Monk
on Jun 13, 2013 at 16:19 UTC ( #1038792=note: print w/ replies, xml ) Need Help??


in reply to Archive::Zip Error

Hi, Is there any way I can ignore Archive::Zip errors? Thanks

Sure, eval


Comment on Re: Archive::Zip Error
Re^2: Archive::Zip Error
by bluesplay106 (Novice) on Jun 13, 2013 at 17:22 UTC
    I did try eval but I received a 'format error: CRC or size mismatch after reading data descriptor' from Archive::Zip and my program still exits. Is there a way to ignore it?

      Is there a way to ignore it?

      eval is the standard mechanism for ignoring errors. If eval isn't working for you, and you want help, you need to post some code

        I can't post my code due to my internship, so here is the general :
        $zip = Archive::Zip->new(); eval {$zip->read($filename);}; if($@) { print "Couldn't unzip $filename\n";}

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2015-07-03 22:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls