Depends. Most often not. Most often you are supposed to use a datastructure that supports that. If you can't use an Uzi, use something heavier. In case you want a case insensitive hash ... there are modules for that on CPAN, if you want some other definition of equality, you can do something similar to what those modules do and if you want to process all items whose keys match some more complex condition you should probably already be using a database. Even if it was just SQLite.
Of course that sometimes looping though all the keys&values is the only solution. And using anything else would either be an overkill or would not help anything, the point is that before you start looping you should be sure you have to. Before you start banging your Uzi over someone's head, you should make sure the Uzi is not loaded. To save time and to make sure you do not shoot yourself in the foot :-)
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- 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
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||