#!/usr/bin/perl -w use strict; my $count = shift; my $interval = 60 / $count; for (1..$count) { system(@ARGV); select(undef,undef,undef,$interval); } #### #!/usr/bin/perl -w use strict; my $count = shift; my $interval = 60 / $count; my ($pid,%kids); for (1..$count) { defined($pid = fork()) or warn $! and last; # can't die, kids to tend $pid or exec(@ARGV); $kids{$pid}++; select(undef,undef,undef,$interval); } delete $kids{wait()} while %kids;