Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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

by clueless newbie (Chaplain)
on Aug 16, 2007 at 13:12 UTC ( #633041=note: print w/replies, xml ) Need Help??

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

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 gotcha! at 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 line 17 E:\>type

Replies are listed 'Best First'.
Re^5: How to locate an error in a CGI application
by rbi (Monk) on Aug 16, 2007 at 13:24 UTC
    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://633041]
[james28909]: and i need to format those special instances into an absolute date instead of "yesterday"
[stevieb]: ask a question on SoPW, and include at least a half-dozen examples of the input, and at least one example of expected output
[davido]: Exactly: SoPW. This isn't going to be solved easily in the CB.
[james28909]: in need "yesterday" and so on, to be absolute like "1" or "31"
[stevieb]: ...and throw some of your existing code into the equation as well, just so readers know you've given a try at it ;)
[james28909]: ok
[stevieb]: davido thanks for the link ;) I was being the typical lazy
[davido]: date parsing is hard. The more examples you can provide of the input (within reason) and expected output, the better.
[stevieb]: agreed. That's why I said at least a half-dozen. If enough of the different formats are present, the date/time folk may not have to request more. If they do, then at least there was a decent base to start with
[stevieb]: I do date and time transformations in both Perl and Python, but not frequently enough to not have to search for the format params etc ;)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2017-04-29 02:38 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (531 votes). Check out past polls.