Archive::Zip and File::Find errors



Hello,

I am using the code below to unzip a whole series of files but am
getting an error message "can't open fred.zip: no such file or
directory" - when the file does exist and can be unzipped if it is the
only file in a folder.

Can anyone see an obvious error?

Cheers

Geoff

#!perl
use warnings;
use strict;
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
use File::Find;

my $dir = 'c:/a-temp2';
my @zips;

find sub {
-d and return;
/\.zip$/ and push @zips, [$File::Find::dir, $_];
}, $dir;

my $zip = Archive::Zip->new;

for (@zips) {
chdir $_->[0] or die "can't chdir to $_->[0]: $!";
$zip->read($_->[1]) == AZ_OK or die "can't read $_->[1]";
$zip->extractTree == AZ_OK or die "can't extract $_->[1]";
}
.



Relevant Pages

  • Re: Switches/field codes to fix zip code in merge
    ... "Peter Jamieson" wrote: ... MERGEFIELD ZIP \# "00000"}"} ... getting the error message "Error! ... I'm trying to get an Excel list that has 5-digit zips and 9-digit zips to ...
    (microsoft.public.word.mailmerge.fields)
  • RE: Argument not optional
    ... The problem is that the error message comes directly after I have ... sub so there must be something strange with the button. ... message "Argument not optional" (as I had not selected any charts but I ... ''' msoButtonAutomatic, msoButtonIcon, msoButtonCaption, ...
    (microsoft.public.excel.programming)
  • RE: Code For Required Fields
    ... > the error message and exit the subroutine. ... Private Sub Form_BeforeUpdate ... > Private Sub Form_BeforeUpdateDim ctl As Control For Each ...
    (microsoft.public.access.formscoding)
  • Re: [VB5] error 5 on unload form
    ... Was the error announced in a msgbox of your own, ... contain no error handling (I am aware of the error handling in case ... You asked for the origin of the error message. ... The sub in the main module is executed to its very end, ...
    (comp.lang.basic.visual.misc)
  • Re: Multi-step OLE DB operation error
    ... response.write eNotes ... > The code that is causing the error message is below (it's taken from ... > Dim sData, adLongVarChar, adLongVarWChar, FieldSize ... > End Sub ...
    (microsoft.public.inetserver.asp.db)