open STDOUT, ">>somelogfile" or die "opening logfile: $!\n"; open STDERR, ">&STDOUT" or die "dup'ing STDOUT to STDERR: $!\n";
Basically, this is the same as example of redirecting STDOUT and STDERR in the docs for open except you don't actually save the filehandles beforehand and restore them afterwards.
In reply to Re: Messin around with fork() and fd's
by wog
in thread Messin around with fork() and fd's
by snafu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |