As noted by previous posters you'll want to read more than expect answers, like perlintro.

Chances are your solution will have the following form:

Open file While the file has lines, read a line of text. { Split the line of text into useful pieces. Save each corresponding field into your desired data structure (in + this case, a hash). } print data (perhaps in another loop foreach of your keys)

You may then attempt to print each line, perhaps after ordering the keys, etc. The cool thing is you've got a lot of flexibility, and Perl makes it easy to make quick changes and see the results immediately.

Start simple, and then tweak it. In a few hours, I think you'll be surprised at all the fun you're having.

Good luck, and next time don't put it off til the last second--because you're really short-changing yourself hours of sheer joy and programming ecstasy that comes with using Perl. (I can understand if you had some ball-n-chain language (like Ruby, C# or Java) you had to deal with why you'd want to put it off til the last second... but not Perl!) Best regards,

--Ray


In reply to Re: Need Help with Hashs plz! by raybies
in thread Need Help with Hashs plz! by Celticrose777

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.