Forking does not seem to be the optimal solution to this.
I would prefer to set a handler for SIGALRM and set an
alarm, something like.
$SIG{ALRM} = sub { die ("Couldn't traceroute"); };
alarm (20);
if ($tracert = `traceroute "$ip"`)
{
alarm (0);
}
# handle data from traceroute here
This is documented in the perlipc perldoc.
1. dude, what does mine say?
2. "sweet", what about mine?
3. "dude", what does mine say?
4. GOTO 2