> I think your pattern match will only catch a literal AZ_OK,
> not the constant. And I'm not sure, but AZ_OK might evaluate
> to 0. At least I think I remember having trouble with that
> module because it returns 0 on success, and I kept testing
> for TRUE/FALSE based on the return status.
Oh it's a constant! Thanks Tim! I thought it was awfully starnge that it was using
numeric operators.
I switched to a regex because I kept getting a "non digit used with numeric operator"
with use strict.
So if zero means it worked what means it failed\how can I tell if $rc means 1 or 0 in
the traditional sense given the Archive::Zip module's strange return values?
my $rc = $member->extractToFileNamed($unzippedfile);
> use Archive::Zip;
> ...
> my $member = $zip->memberNamed($zippedfile);
> my $rc = $member->extractToFileNamed($unzippedfile);
> if($rc =~ m/AZ_OK/) { print "ok -$rc-\n; } else { print
> "Bad -$rc-\n"; }
>
> The code above *always* prints:
> Bab -0-
>
> But $unzippedfile is created properly, everytime, even if I
> delete it first and run it again!!! So shouldn't $rc have
> AZ_OK in it or even better be 1 on success? Or is writing the
> text file in the zip archive to a local text file not
> success? What could I be doing wrong/missing?
>
> TIA
>
> Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]