in reply to Re: delayed die and open3
in thread delayed die and open3
An excellent example that makes it pretty clear what is going on, thanks. I am still puzzled though, the die runs in the child but how did the die get in there ? Is open3 forking and if so how does it decide to run the die but not the following print which comes only from the parent. Is there any way in the parent to trap failure of the child ?
# here the die runs in the child: nph>perl -MIPC::Open3 -le'print "dad: $$";eval {$pid = open3(*IN, *OUT +, *ERR, @ARGV);}; die "$$ ACK $@\n" if ($@);print <ERR>' nosuch dad: 62718 55596 ACK open3: exec of nosuch failed at -e line 1 # yet here in the same code it runs in the parent !!! nph>perl -MIPC::Open3 -le'print "dad: $$";eval {$pid = open3(*IN, *OUT +, *ERR, @ARGV);}; die "$$ ACK $@\n" if ($@);print <ERR>' dad: 25600 25600 ACK open3(*main::IN, *main::OUT, *main::ERR): not enough argumen +ts at -e line 1 # and if I remove the print <ERR> I alter the behaviour again nph>perl -MIPC::Open3 -le'print "dad: $$";eval {$pid = open3(*IN, *OUT +, *ERR, @ARGV);}; die "$$ ACK $@\n" if ($@);print "moo" ' nosuch dad: 55592 moo nph>
Thanks,
R.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: delayed die and open3
by tlm (Prior) on Mar 31, 2005 at 17:22 UTC | |
|
Re^3: delayed die and open3
by RazorbladeBidet (Friar) on Mar 31, 2005 at 16:46 UTC | |
by Random_Walk (Prior) on Mar 31, 2005 at 17:10 UTC | |
by RazorbladeBidet (Friar) on Mar 31, 2005 at 17:24 UTC |