Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: How to locate an error in a CGI application

by rbi (Monk)
on Aug 16, 2007 at 12:29 UTC ( #633032=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How to locate an error in a CGI application
in thread How to locate an error in a CGI application

Thanks, at least now I know what to debug in my code.


Comment on Re^3: How to locate an error in a CGI application
Re^4: How to locate an error in a CGI application
by clueless newbie (Hermit) on Aug 16, 2007 at 13:12 UTC
    Mind you, I'm rather clueless, so take what I say with a ton of salt:

    Try adding a "use Carp;" and an INIT block like "INIT { $SIG{__WARN__ }=sub { carp "Caught it"; } };"

    #!/usr/bin/perl use warnings; use Carp; INIT { $SIG{__WARN__}=sub {carp "gotcha!";}; }; my $code_err = q| my @arr; my $i; $arr[$i] = 0; # line 4 within this code snippet |; my $code_ok = q|my $var = ""|; eval $code_ok for (1..8); eval $code_err; # 9th eval, but line 14 in this script E:\><code> gets me <code>E:\>perl example.pl gotcha! at example.pl line 6 main::__ANON__('Use of uninitialized value in array element at + (eval 9) line 4.\x{a}') calle d at (eval 9) line 4 eval ' my @arr; my $i; $arr[$i] = 0; # line 4 within this code snippet ;' called at example.pl line 17 E:\>type example.pl
    clueless
      Now it says Gotcha! at (eval 9) line 86., referer: http://my.server/cgi-bin/mainscript.cgi?feature=a
      but still don't know what :) Is there a way to print the eval argument ?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://633032]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2015-07-05 10:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (64 votes), past polls