in reply to Perl infinite loops!
Somewhere near the top of your cgi script you could put something like the following:
You could even go as far as printing a warning message if the script is killed this way:
Which will kill the cgi script's process (with a SIGALRM) 3 minutes after execution of that line of code.alarm(180); # stop script after 3 minutes
You could even go as far as printing a warning message if the script is killed this way:
$SIG{ALRM} = \&sighandler; sub sighandler() { print "WARNING: Script timed out or was killed\n"; exit (0); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Perl infinite loops!
by marvell (Pilgrim) on Dec 06, 2000 at 21:02 UTC | |
Re: Re: Perl infinite loops!
by silicon39 (Initiate) on Dec 06, 2000 at 22:17 UTC | |
by kilinrax (Deacon) on Dec 06, 2000 at 23:10 UTC |
In Section
Seekers of Perl Wisdom