#!/usr/bin/perl use strict; use ForkControl; my @hosts = qw/host1 host2 host3 host4 host5/; my $motherforker = ForkControl->new( Name => 'forker', MaxKids => 100, MinKids => 5, ProcessTimeout => 30, WatchLoad => 1, MaxLoad => 15.00, Code => \&telnet_to_host ); foreach my $host (@hosts) { $motherforker->run($host); } sub telnet_to_host { my $host = shift; open(FILE, "> $host"); # # telnet to the thing print FILE "yay!"; close FILE; }