in reply to Getting STDERR to write to STDOUT?

CGI::Carp provides this functionality for you.
BEGIN { use CGI::Carp qw(carpout); open(LOG, ">>/usr/local/cgi-logs/mycgi-log") or die("Unable to open mycgi-log: $!\n"); carpout(LOG); }
BTW, in case you are doing this to see error messages in the browser window, you should use:
use CGI::Carp qw(fatalsToBrowser);
near the top of your CGI script.

Russ