Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Return Values from IPC::Run

by and (Pilgrim)
on May 04, 2006 at 06:43 UTC ( [id://547349]=note: print w/replies, xml ) Need Help??


in reply to Return Values from IPC::Run

You are setting $exit to be the opposite of what 'run' returns. You want
run ... and $exit = 1;
just like you should write
system( ... ) and die ...
these being a couple of the rare Perl functions that return 0, a false value, to indicate "no failure" instead of the much more usual "true means success" scheme.

Update: Checking the documentation, I couldn't find any direct mention of what run() returns but it was certainly used as if "true means success" and looking at the source, it appears to return the equivalent of ! $?. So my instinct and advice was wrong. Sorry. It just fit the problem statement so well. Drat. But your claim of what $? returned contradicts this so maybe you've got some version that I'd have to dig out of backpan and I'm actually right after all. ;->

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-07-14 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.