perldoc -q timeout Found in /usr/share/perl/5.8/pod/perlfaq8.pod How do I timeout a slow event? Use the alarm() function, probably in conjunction with a signal handler, as documented in "Signals" in perlipc and the section on ``Signals'' in the Camel. You may instead use the more flexible Sys::AlarmCall module available from CPAN. The alarm() function is not implemented on all versions of Windows. Check the documentation for your specific version of Perl.