Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: delayed die and open3

by cazz (Pilgrim)
on Mar 31, 2005 at 15:31 UTC ( [id://443860]=note: print w/replies, xml ) Need Help??


in reply to delayed die and open3

eval is not trapping the failed open3 call as you expect. Trim your code down to this:
[bmc@hacked lib]$ perl -MIPC::Open3 -e 'eval {$pid = open3(*IN, *OUT, +*ERR, @ARGV);}; print "ACK $@\n" if ($@);' asdf [bmc@hacked lib]$
Note that ack isn't printed. eval is working as expected as you can see when you call the same code with no args:
[bmc@hacked lib]$ perl -MIPC::Open3 -e 'eval {$pid = open3(*IN, *OUT, +*ERR, @ARGV);}; print "ACK $@\n" if ($@);' ACK open3(*main::IN, *main::OUT, *main::ERR): not enough arguments at +-e line 1 [bmc@hacked lib]$

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-07-17 19:15 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.