#!/usr/bin/perl use feature qw/say/; my $count = 1; CLIENT: for my $i (1..33){ if ( $count > 10 ) { say "waiting for open process"; while (1) { if ( wait() ){ $count = 1; redo CLIENT; } } } else{ # Stagger the initiating to help CPU sleep(5); } $count++ and next if( my $pid = fork() ); unless( $pid ){ say "Processing client $i process count $count"; # Emulate the time it would take to process.. sleep(60); exit; } }