Time::Limit sends the process a SIGTERM, which you can catch.The following exits with a zero exit code after 5 seconds:
use Time::Limit -quiet, '5'; $SIG{TERM} = sub { exit 0 }; while(1) {}
In reply to Re^3: Self terminating a script after a specified time
by Anonymous Monk
in thread Self terminating a script after a specified time
by shardservant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |