It's usually a better practice when asking for help here to explain what you've tried, and how it's failing, but not to dictate what tools a proper solution should employ.
He may not have explicitly stated it, but this is clearly a homework assignment. The "solve by using split one or more times" requirement is part of the assignment. Even if he knew other ways to do it, the instructor has declared them to be out of bounds.

Beyond that, he's also provided his source code in the question, which qualifies as "explain[ing] what you've tried" in my book. The only thing missing from the question is a statement of how it fails, although I expect that was obvious to most experienced monks pretty quickly (as CountZero said, he forgot to read from the file after opening it).


In reply to Re^2: Help to split by dsheroh
in thread Help to split by semenych

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.