in reply to Re: Do I need/want to close __DATA__?
in thread Do I need/want to close __DATA__?

I use warn because I need that line number (the line 2 and not the <DATA> line 290.. I mean is helpful in knowing what's going on

Replies are listed 'Best First'.
Re^3: Do I need/want to close __DATA__?
by AnomalousMonk (Archbishop) on Apr 13, 2020 at 19:32 UTC

    warn "xyz at line ", __LINE__, "\n";


    Give a man a fish:  <%-{-{-{-<

Re^3: Do I need/want to close __DATA__?
by LanX (Saint) on Apr 13, 2020 at 22:20 UTC
    I have problems understanding your problem.

    you said in the OP

    > I don't want to have my scripts mention that someone else's __DATA__ is opened on some line urelated

    • So either the warn is for an end-user, then hide all coordinates by appending "\n"
    • Or it's for you, then ignore the DATA part.
    This might be a little irritating, but IMHO it's a not too tragic side-effect of Perl trying to be explicit.

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