#!c:\perl\bin\perl use Net::AIM; use strict; use warnings; my $counter = 0; my $done; while (1==1) { if ($counter <= 3) { my $pid = fork(); if ($pid) { print "forking process $counter.\n"; $counter++; } else { ############meat########################### # pretty much just # straight copy/pasted from main script ###########/meat########################### exit $counter; } } else { $done = wait(); $counter--; } }