BEGIN {#outputs al errors to use CGI::Carp qw(carpout); open(LOG, ">>myScript.err.log") or die "can't W 2 myScript.cgi.err.log: $!"; carpout(*LOG); }