Caveats: doesn't work if the program uses eval or sleep, and might not work with retry I/O models. (But beginners aren't likely to use these things!)
BEGIN { $SIG{ALRM} = sub { die "Infinite loop aborted" }; alarm 30; # or however long you want before you time out (in seconds +) }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE (tilly) 1: Poor man's setrlimit
by tilly (Archbishop) on Oct 16, 2000 at 18:41 UTC | |
by merlyn (Sage) on Oct 17, 2000 at 00:46 UTC | |
by tilly (Archbishop) on Oct 17, 2000 at 00:53 UTC |