FORK: { if (my $child = fork()) { print "Child process ID: $child\n"; } elsif (not defined $child) { # failed to fork. next FORK; } else { # child. open(STDOUT, '>somefile); close(STDIN); # just good practice for background procs exec($program, @program_args); } }