Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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

Replies are listed 'Best First'.
Re^4: How to locate an error in a CGI application
by clueless newbie (Chaplain) 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?
[robby_dobby]: Likewise! I haven't seen a lot of people with HAs back where I come from, so I figured it might be the same around here too...
[robby_dobby]: Oh, shit -- I was replying to someone, but it wound up here. -_-
robby_dobby is still not used to PM's interface. /o\
[oiskuu]: War. War never changes.
[robby_dobby]: "My cat is a very good mouser" -- that's a great way to identify a Brit among a crowd :-)
thezip looks around to see no one else dancing to Piazzola...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (14)
As of 2017-11-17 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (272 votes). Check out past polls.

    Notices?