#!/usr/bin/env perl use strict; use warnings; my @a = (1,2,3); for my $i (@a) { my $pid = fork(); if ( $pid == 0 ) { print "$i -> i am a forked child\n"; exit; } else { print "$i -> forking $pid\n"; } } while((wait()) > 0) {}; ####