Hi Monks,

My script, all of a sudden whenever I warn it gives me at the end this: <DATA> line 290. . In particular, try:

use Geography::Countries::LatLong; warn "xyz";

And true enough this module reads its __DATA__ section. But is there such thing as forgetting to close it? Because a) I don't want to have my scripts mention that someone else's __DATA__ is opened on some line urelated and b) I spent 5 minutes investigating and that's 5 minutes too much right now.

In this particular module, __DATA__ is read in a loop and that's it, no further reference to it.

So the questions are: in general can I close __DATA__ which my module/script opened? And should any module close its __DATA__ when done with it? Otherwise, will I have to live with <DATA> line 290 messages all my Perl life?

bw, bliako


In reply to Do I need/want to close __DATA__? by bliako

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.