Try using this:
use CGI::Carp qw/fatalsToBrowser/; sub cgierr{ my ($error, $nolog) = @_; if ( $config{'debug'}==-1 ){ #### TBD: generic error report goes here # return 1; exit; } print $in->header(); #Begin detailed error and debug reporting if ($config{'debug'}) { print "<PRE>\n\nDEBUG\n======================================= +===\n"; } else { print "<PRE>\n\nCGI ERROR\n=================================== +=======\n"; } $error and print "Error Message : $error\n"; $0 and print "Script Location : $0\n"; $] and print "Perl Version : $]\n"; $random_variable_I_want_to_see and print "random variable I want +to see : $random_variable_I_want_to_see\n"; print "\n\nInput Parameters\n------------------------------------- +------\n"; foreach $key (sort $in->param) { my $space = " " x (20 - length($key)); print "$key$space: " . $in->param($key) . "\n"; } print "\nCookies\n-------------------------------------------\n"; print "\n$config{'userpass_cookie_name'} : " . $in->cookie($config +{'userpass_cookie_name'}); print "\n$config{'userid_cookie_name'} : " . $in->cookie($config{' +userid_cookie_name'}); print "\n$config{'back_do_cookie_name'} : " . $in->cookie($confi +g{'back_do_cookie_name'}); print "\nEnvironment Variables\n---------------------------------- +---------\n"; foreach $env (sort keys %ENV) { my $space = " " x (20 - length($env)); print "$env$space: $ENV{$env}\n"; } print "\nStack Trace \n------------------------------------------- +\n"; my $i = 0; while (my ($file, $line, $sub) = (caller($i++))[1,2,3]) { print qq!($sub) called from ($file) line ($line)<BR>\n!; } print "\n</PRE>"; &log_action ("CGI ERROR: $error") if (!$nolog and $config{'logfile +'}); exit; }
..and then use it to target suspected error locations, like this:
<..lines of code..> &cgierr("fatal undef error: $@", 1);
Also, the visual debugger that comes with Activestates dev kit works well in this instance, but you can also (specuially if you are using CGI) use the debug option when you invoke the script manually and trace it through on the commandline, but that is a bit messy looking the first couple times you do it.

*G*

In reply to Re: IIS CGI ErrorLog by growlf
in thread IIS CGI ErrorLog by averylongloginname

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.