in reply to Messin around with fork() and fd's
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.
|
|---|