in reply to open pipe for input and die
Why not use the fact that a pipe-open returns the PID of the child on success?
my $child = open my $y, '/usr/bin/sleep 5|' or die "Couldn't spawn: $!/$?"; END { kill 9, $child if $child; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: open pipe for input and die
by pht (Acolyte) on Dec 11, 2008 at 09:37 UTC |