#!C:\perl\bin\perl.exe $|= 1; my $counter= 1; while ($counter) { print "\n\nStart: $counter"; if( fork() eq 0 ) { countup($counter); exit; } print "\nEnd: $counter"; $counter++; sleep 1; } exit; sub countup { my $counter= shift; print "\nInFork: $counter"; return; }