my $pid = fork; if (defined $pid and $pid == 0) { open STDOUT, ">", $fn or die; exec $script, @args; exit 1; } if ($pid) { waitpid($pid); $? and die "error on child: $?" } else { die "unable to fork: $!"; }
In reply to Re^5: How to print STDOUT to a file
by salva
in thread How to print STDOUT to a file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |