in reply to Debugging CGI/PERL

My errors are happening within IF statements - and they are compile time errors - I guess thats how you describe them. Anyway, I dont understand what i do with the _FILE_ example.

Replies are listed 'Best First'.
Re^2: Debugging CGI/PERL
by davorg (Chancellor) on Mar 21, 2007 at 16:54 UTC

    I don't understand how adding "if" statements to a program makes it harder to debug. Perhaps you could give a (short) example.

    And if you told us which compile time errors that you're getting then we might be able to help you fix them.

    Have you tried adding "use diagnostics" to your code?

    --

    See the Copyright notice on my home node.

    "The first rule of Perl club is you do not talk about Perl club." -- Chip Salzenberg

Re^2: __FILE__
by Bro. Doug (Monk) on Mar 21, 2007 at 16:47 UTC
    __FILE__ and __LINE__ are special perl variables that give the file name and line number, respectively. You can also try caller(), but I'm not sure how that behaves inside an IF.
    Bro. Doug :wq
      You can also try caller(), but I'm not sure how that behaves inside an IF.

      It works the same way it does anywhere else; nothing if does intrinsically changes the call stack.