At this point it's pretty obvious that this is just a series of exercises for which you are asking for an answer. Beyond the fact that perlmonks is not a code writing service (you can't rely on being given a full answer, because perlmonks is more about giving means and corrections, not the full solution), this means that there's a chance that you are expected to explore or demonstrate a specific tool or idiom of perl. But (one of) perl's motto is "There is more than one way to do it", so even if you get *a* solution, it might not be the expected one, and you probably won't have learned what you were meant to learn.

For example in this case, this might be an exercise meant to demonstrate the use of slices, or split, or while with last... (there are plenty of other tools that could be used, but these are the most straightforward for your problem IMHO). It might even be about oneliners, in which case there's a very high chance that you'll just be given a solution that's completely out of topic.


In reply to Re: hash of hash by Eily
in thread hash of hash by Tigor

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.