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); }
In Section
Seekers of Perl Wisdom