Perl internals (& my neophyte status) not withstanding, I can only offer the following... Every memory location in every computer ever made, is accessed "numerically". That's just the way things are, so if you want the corresponding "Value" of green to the "Key" of Color, You must use a "hashing algorithm" (ha)to compute a numerical memory address from the bits-value of 'color'. There are several known hashing Algorithms and each is designed to work better than another on different sizes of files, arays, tables, hashes, or what-have-you. On the systems I work on, we can set the seed of these ha's to 0,1,2,etc. & create a more efficient (polynomial)Algorithm as the file size increases. Not sure if perl utilizes different ha's internally or not. By accessing an Array via its relative numeric index, getting the nth element would be faster, but looking for the element containing 'Color' would require a sort & a B-Tree Algorithm, making it slower than a hash. IMHO, but again, I'm just learning. ;-) That's it, for what it's worth.
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.