in reply to Confusing warning with if/elsif/else

Yes, because the problem is with the 'if' statement (the elsif is part of the if statement). Perl only records where a statement (or rather, a corresponding op-code) starts - and that's what's being used in the message.

Note that the warning has nothing to do with 'strict'. In fact, if it's a warning, it cannot be caused by the strict pragma. The strict pragma throws fatal errors.

Perl --((8:>*
  • Comment on Re: Confusing warning with if/elsif/else

Replies are listed 'Best First'.
Re^2: Confusing warning with if/elsif/else
by sanPerl (Friar) on Dec 09, 2005 at 06:50 UTC
    >>Yes, because the problem is with the 'if' statement (the elsif is part of the if statement).
    >>
    You are correct. Perl considers if..elsif..else as a complete if box. Hence it is pointing towards line number of 'if'.
    I Didn't know this, this is a good tip for debuggers indeed