SYNOPSIS In a script: # run for at most 30 seconds use Timeout::Self qw(30); From the command line: % perl -MTimeout::Self=30 yourscript.pl DESCRIPTION This module simply installs a $SIG{ALRM} that dies, and an alarm() call with a certain value.