Archive::Zip#ERROR_CODES (couldn't get the link to ERROR_CODES to work).
use Archive::Zip qw(:ERROR_CODES :CONSTANTS); my $zip2_path = 'c:/usr/test/file.zip'; my $zip2 = Archive::Zip->new(); unless ( $zip2->read( $zip2_path ) == AZ_OK ) { die "$zip2_path read error"; }
It does return an error if you call it this way. It says in the module docs at cpan you can put the file name in the constructor but you don't get the error code. If you read it with an object method like this you do. Also, did you check for .zip ending? That doesn't guarantee anything but could weed out files that shouldn't be attempted to open.
In reply to Re: Checking if a file is present in a ZIP archive
by Gulliver
in thread Checking if a file is present in a ZIP archive
by bontchev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |