Further research...given this:
#!/your/perl/here use strict; use warnings; my $rand = rand; if ( $rand < rand ) { print "if1: $rand\n"; } elsif ( $rand < rand ) { print "elsif2: $rand\n"; } else { print "else3: $rand\n"; }
works fine. Changing line 11 to:
elsif ( ( $rand < rand ) { print "elsif2: $rand\n"; }
gives the error:
syntax error at C:\if_elsif.pl line 12, near ") {"
But using this version instead:
elsif ( $rand < _rand ) { print "elsif2: $rand\n"; }
gives the compile error:
Bareword "_rand" not allowed while "strict subs" in use at C:\if_elsif +.pl line 7.
Given that you can chain elsifs together indefinitely, it is possible to cause an error at any line after line 7, but still be pointed to line 7.

You may be wondering what happens if use strict is turned off - it just generates a warning instead:

Argument "_rand" isn't numeric in numeric lt (<) at C:\Perl\perlmonks\ +if_elsif.pl line 7.
Turning off warnings then doesn't complain. I was unable to generate a message that pointed to some line besides the line of the actual error +/-1. Only turning on strict and warnings caused misleading messages.

So it appears (from minimial empirical evidence) that syntax errors generate mostly correct line numbers, but strict and warnings do not, probably because information about the structure of the if/elsif/else has been removed from the [insert appropriate entity name here]

However, if another if/elsif/else is nested in one of the if blocks, it's if entry point is retained (but it's elsif/else info is not).

The remaining question I have is:

What information is thrown out, and at what stage of the compilation/execution?
[The original question, "Why doesn't the debugger pause on elsif conditionals?", seems to hinge on the answer to this new question.]

-QM
--
Quantum Mechanics: The dreams stuff is made of


In reply to Re^6: No Pause on Elsif in Debugger (history) by QM
in thread No Pause on Elsif in Debugger by QM

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.