You really ought to be using __END__ instead of __DATA__. See the SelfLoader POD explanation of the way the __DATA__ is intended to be used.

Notice that the first warning is issued for the data produced from the second input record. The fact that next if not $line; allows you to avoid the warnings tells us that $line is an empty string (it could not be uninitialized, since this would terminate the while loop). This means that either the string stored in $/ is being read immediately after the end of the first input record, or that your perl build's IO is broken or confused by the record delimiters in the text. What is the value of the $/ variable?

For testing, on the line before your while() loop, insert the following assignment:

$/ = '|';

change the text after the __DATA__ token to (the data text should be on one line):

__DATA__ filename1:some/file/path|filename2:some/other/file/path|filename3:yet/ +another/file/path/oooh/this/one/is/long

and split with the pattern: /:/

If the warnings go away, I suspect there is a problem with your record delimiters (LF, CR/LF, etc.) or the default value of $/.


In reply to Re: odd behavior with DATA section by converter
in thread odd behavior with DATA section by Nkuvu

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.