in reply to Re: how to kill subprocess when it goes longer than 20 seconds?
in thread how to kill subprocess when it goes longer than 20 seconds?

is this correct?
my $temppid = open (SYS, "/bin/tcsh $tempfilename | ") or die "$!"; kill $temppid if (alarm (5)); while (<SYS>) { print "[DEBUG] $_ <br>"; } close SYS;

Replies are listed 'Best First'.
Re^3: how to kill subprocess when it goes longer than 20 seconds?
by izut (Chaplain) on Mar 28, 2007 at 17:41 UTC

    Check alarm documentation. There's a lot of examples how you do that.

    Igor 'izut' Sutton
    your code, your rules.