- or download this
my $pid = open2($rfh, $wfh, "ssh $opts $hostspec $cmd");
- or download this
### Self-pipe init.
pipe(SIGRD, SIGWR);
# Make SIGRD non-blocking.
vec($rin, fileno SIGRD, 1) = 1;
- or download this
my $byte = 1;
syswrite(SIGWR, $byte, 1);
- or download this
my $nfound = select($rout = $rin, $wout = $win, undef, undef);
# Check $nfound for errors.
...
# CHLD arrived, do waitpid(), modify some data, ...
}
}