in reply to Timeout on system command

The general problem of timing out a slow event is discussed in the Perl Cookbook 2nd edition, Recipe 16.21 "Timing Out an Operation" and also in perlfaq8 "How do I timeout a slow event". On Unix, I suggest using $SIG{ALRM}/alarm (carefully). On Win2K and above, I recommend the Win32::Job module.

See also Timing and timing out Unix commands and Timing Windows commands.