: Is there a way to arrange for stderr to be redirected to some file,
: without having to use the >& notation every time you start a program? (I
: can't do that because my programs are CGI scripts that are launched by my
: web server; I need a way to debug these scripts, as regular stderr to the
: console is simply lost when one is in a web browser.)
"In a CGI environment, STDERR points to the server error log file. You
can take this to your advantage by outputting debug messages, and then
checking the log file later on.
Both STDIN and STDOUT point to the browser. In actuality, STDIN actually
points to the server which interprets the client (or browser's) request
and information, and sends that to the script.
In order to catch errors, you can "dupe" STDERR to STDOUT early on in
your script (after outputting the valid HTTP headers): "
open (STDERR, ">&STDOUT");
"Nasal spray ... do you know where I can score some?"
- Charles Demar from _Better Off Dead_