Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I tried that, it was actually lines that ended only with a carriage return that didn't increment the value of __LINE__.

It's probably what causes phramus's problem I guess. If not, I only know of two other ways to have __LINE__ (which is replaced at compile time, so should not be affected by runtime operations) corresponding to something else than what seems obvious: source filtering and the #line directive:

package Third; use Filter::Util::Call; $\ = $/; $, = ":"; print 4, __LINE__; ## Hello BEGIN { filter_add ( sub { $status = filter_read(); $_ = "" if /^##/; +return $status; } ); } print 7, __LINE__; ## World; print 9, __LINE__; #line 42 print 11, __LINE__;
4:4
7:7
9:8
11:42

There the source filtering removes all lines starting with two #, but it has no effect on lines before the filter function is added, even though it's in a BEGIN block. So if the problem is source filtering, it has to be from a module included earlier (in the command used to run the script for example). And well, if phramus used #line 42 like comments in his script to keep track of the line number, that's tough luck.


In reply to Re^2: Bad line numbers .. bad! by Eily
in thread Bad line numbers .. bad! by phramus

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (9)
    As of 2014-12-17 23:17 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (40 votes), past polls