#!/usr/bin/perl # stopafter - run a command with a timeout my $time = shift; alarm($time); exec @ARGV; die "Couldn't exec @ARGV: $!; aborting"; #### stopafter 300 command arg arg... #### open FH, "stopafter 10 command |" or die ...;
## stopafter 300 command arg arg... ##
## open FH, "stopafter 10 command |" or die ...;