BEGIN { use CGI::Carp qw(carpout); open(LOG, ">>C:/mycgi-log") or die("Unable to open mycgi-log: $!\n"); carpout(LOG); }