$SIG{ALRM} = \&sighandler; sub sighandler() { print "WARNING: Script timed out or was killed\n"; exit (0); }