I thought I mentioned I was looking for AWTDI. On a personal note, I enjoy hashes over arrays.
I find it more intuitive to say $hash{10} to get the tenth line, than
$array[9]. I also
like being able to 'delete $hash{10}' and actually have my hash have 1 less key. And, I would have to
benchmark this, but since I was just looking for AWTDI, I don't care enough to, but depending on the size
of the file, the hash lookups should be faster.
PS: Before someone says that you can delete an array element.. yes, you can. But all it does it
put that element back to an uninitialized state, it doesn't really delete the element. If you have an array with
10 elements, and you delete one, you still have 10 elements.
Cheers,
KM
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.