my $pid = fork; die "Fork failed me!\n" if !defined($pid); if ( $pid == 0 ) { # I'm the child! exec("ls -l > ls.out"); } # I'm the parent! sleep 5; #or whatever