for my $file ( <*.log> ) { # for example... defined( my $pid = fork ) or die "Unable to fork: $!"; unless ( $pid ) { # in child # process $file exit; } } 1 while wait > 0; # avoid zombies