for (1 .. $maxthreads) { my $pid = fork(); if (!defined($pid)) { die "couldn't fork: $!"; } else { #child bot( nick => "$nickbase$randnum" ); print "new child: number $threadcount"; # exit; } sleep 5; $threadcount++; }