in reply to Re: Perl's __LINE__ off by 2 (Introspection)
in thread Perl's __LINE__ off by 2

The contents will be much more clear if you $Data::Dumper::Useqq=1; before the say Dumper

Replies are listed 'Best First'.
Re^3: Perl's __LINE__ off by 2
by LanX (Saint) on Aug 26, 2025 at 10:20 UTC
      Not sure what you mean? Dumper doesn't AFAIK have interpretations of CR LF, it is just showing the data, either outputting it raw (for the CRLF-relevant characters) or as escapes with Useqq, where \r means chr(0x13) and \n means chr(0x10) (assuming non-EBCDIC). If perl is opening the source in text mode, a binmode *DATA; before the seek/read may be good (don't know if that even works or if *DATA is somehow magic in a way that prevents changing layers).

        > Not sure what you mean?

        see Re: Perl's __LINE__ off by 2

        The OP thinks that he has a mix of newlines in his source, leading to different line interpretations by Perl and his editor.

        I'm pretty sure that <DATA> gives me the lines the same way the compiler sees them.

        A dump OTOH might add another layer of confusion.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        see Wikisyntax for the Monastery