t; > 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.
>
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
> 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
Muey
Cc: [EMAIL PROTECTED]
Subject: RE: Archive::Zip funnny return status
On Wed, 6 Aug 2003 11:33:18 -0500, "Dan Muey" <[EMAIL PROTECTED]> wrote:
>
> > > I think your pattern match will only catch a literal AZ_OK, not
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 s
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 cre
Use eval and check $@ for error checking.
--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]
From: "Paul Kraus" <[EMAIL PROTECTED]>
To: "'Perl'" <[EMAIL PROTECTED]>
Subject: Return Status
Date: T
On Dec 10, Paul Kraus said:
>instead of setting my own $error can I instead just check if &mount
>completed ok? Is there a better way to do this?
Sure.
>sub mount{
>!system
>"mount","-t","smbfs","-o","username=$ini{$section}{username},password=$i
>ni{$section}{password}",
>
>"//$ini{$sec
...
sub mount{
... do stuff ...
# the last evaluated value is automatically returned
! system(...);
}
Rob
-Original Message-
From: Paul Kraus [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 5:28 PM
To: 'Perl'
Subject: Return Status
instead of setting my own $e
instead of setting my own $error can I instead just check if &mount
completed ok? Is there a better way to do this?
Code Snip
-
Foreach loop
...
&mount;
next if ($error == 1);
mkdir "//backup/$ini{$section}{machine}" unless (-e
"/backup/$ini{$section}{machin
--- "Morse, Loretta" <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> While running a perl script on NT is there a way to capture the
> return status of a command? I know how to do this on unix but it
seems
> to be different on NT. I know there is a variable called e
Hello,
While running a perl script on NT is there a way to capture the return
status
of a command? I know how to do this on unix but it seems to be different
on NT. I know there is a variable called errorlevel on NT but not sure how
to access this from a perl script.
Here is what I'm tryi
12 matches
Mail list logo