in reply to Re^3: Timer Question
in thread Timer Question

it is a "system() call", how can I kill this after a certain amount of time...will alarm work per the other responses... Your help is greatly appreciated.

Replies are listed 'Best First'.
Re^5: Timer Question
by salva (Canon) on Feb 17, 2006 at 18:42 UTC
    On some systems, you can set an alarm on a child process like that:
    # instead of system("/foo/bar") do... my $pid = fork; if (defined $fork and not $fork) { alarm $timeout; exec "/foo/bar"; exit(1); # just in case exec fails. }