As stated above, yes, Perl can handle a hash of this size - assuming sufficient memory. However, this is probably not ideal on a lot of computer systems. I would highly recommend either a MySQL database or a restructuring of the data to a fixed-length, sorted format that you can then do an ordered lookup on whenever you need to locate a record. The latter method does require loading all the data into memory and then sorting it once, but you could theoretically do that on someone else's computer if necessary, since it's a one-time thing. The sorted data, once written to disk, would take virtually no overhead or lookup time to locate a specific record (specifically, log2 n, where n is the total number of records). The MySQL database would have the advantage of more flexibility, and you don't necessarily have to feed MySQL the records one at a time - you could just convert the data line by line to INSERT commands and then save as .sql and do an import all at once. Probably a way to do it directly from CSV or delimited or fixed-length as well. As long as the database is on the same computer as the data file, you should get pretty fast import.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.