Try setting $/ = ""; before you start to read in data. This will cause each <INPUT> to grab one paragraph of data, rather than one line. See perlvar.

Note that each paragraph will include the blank line at the end.

So you could say:

$/ = ""; $players1 = <INPUT>; $totals1 = <INPUT>; $players2 = <INPUT>; $totals2 = <INPUT>;
... to grab your data in chunks. You could split each chunk on "\n" characters to get the individual players.

Update: I should mention that this presumes your blank lines are really blank, with no whitespace!

buckaduck


In reply to Re: Running a Sub for a Text File by buckaduck
in thread Running a Sub for a Text File by Perl Newby

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.