Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Good localtime friends,

Given a large 1000+ line file with the following format (flexible here):
Collection=>168245 ImageCount=>6 Status=>SI Missing=>1,3 Modified=>01/ +18/2012 11:14:30 Collection=>161745 ImageCount=>6 Status=>I Missing=>2,3 Modified=>01/1 +8/2012 11:16:38 Collection=>162451 ImageCount=>6 Status=>SC Missing=> Modified=>01/20/ +2012 11:16:38 Collection=>117481 ImageCount=>8 Status=>C Missing=> Modified=>01/18/2 +011 7:16:38 ...
What would be the best way to extract all the information into a hash so that I can can perform sorts based on Collection, Status, and Modified?

Some caveats:
1)Collection would be the db equivalent of an unique id.
2)I cannot use a database or non-core modules.
3)I will dynamically build web pages displaying collection information on a table row based upon a timeframe a user requests, so I will have to play with dates a bit.
4)The creation of the file containing the format about is done in the background, so anything I can do to speed up fetching/sorting specific to file format etc would be worth considering.

Thanks for your advice,

In reply to Extracting information from file to Hash by hok_si_la

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (3)
    As of 2017-08-24 11:12 GMT
    Find Nodes?
      Voting Booth?
      Who is your favorite scientist and why?

      Results (367 votes). Check out past polls.