Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^3: fork() interferring with backtick

by vsespb (Chaplain)
on Oct 16, 2013 at 19:14 UTC ( #1058538=note: print w/replies, xml ) Need Help??

in reply to Re^2: fork() interferring with backtick
in thread fork() interferring with backtick

REAP called for external programs called with backtricks, however it seems it does not affect anything in your case.
my $queue = []; sub REAP { my $kidpid; print STDERR "HANDLER\n"; while(($kidpid = waitpid(-1,WNOHANG)) > 0) { print STDERR "reaped $kidpid\n"; push @$queue, [ $kidpid, $? ]; } print STDERR "/HANDLER\n"; } $SIG{'CHLD'} = \&REAP; `echo 1`; my $pid = fork(); print STDERR "FORK CHILD $pid\n" if $pid; exit unless ($pid); print STDERR "before sleep\n"; sleep 2; print STDERR "after sleep\n"; print STDERR "DONE\n"; __END__ HANDLER /HANDLER FORK CHILD 29104 before sleep HANDLER reaped 29104 /HANDLER after sleep DONE

Replies are listed 'Best First'.
Re^4: fork() interferring with backtick
by mkaiser67 (Initiate) on Oct 17, 2013 at 19:02 UTC
    I think my problem has to do with I'm running 5.14 - my system hasn't been upgraded yet

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2016-10-22 05:13 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (292 votes). Check out past polls.