in reply to system() with timeout

Yes. Here's an example of some code I use that does this (but alarm, as I've heard, may be unsafe in older Perls):

#!/usr/bin/perl use strict; use warnings; my $timeout = 180; my @array = ( "command 1 goes here", "command 2 goes here", "command 3 goes here", ); for (@array) { eval { local $SIG{ALRM} = sub { die "alarm\n"; }; alarm $timeout; system($_); alarm 0; };