Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Do you know where your variables are?
 
PerlMonks  

Re: Tied Hashes vs. Objects

by sundialsvc4 (Monsignor)
on Oct 22, 2012 at 18:10 UTC ( #1000398=note: print w/ replies, xml ) Need Help??


in reply to Tied Hashes vs. Objects

If you need case-insensitive keys, just lc() the name and store the unaltered name as part of the value (which is itself a hash).   An object wrapper for all of this is generally a fine idea because it encapsulates all of the gory details into one module so they won’t spread.   Why give any second thought to “performance?”   Next year’s hardware will always be faster.   (This is not a performance-critical edge case.)   If the software is unmaintainable over the course of several years, it will be counted vastly more expensive than the “iron.”


Comment on Re: Tied Hashes vs. Objects
Re^2: Tied Hashes vs. Objects
by Anonymous Monk on Oct 22, 2012 at 18:35 UTC
    Dear fellow monk, thanks for your advice. Rest assured, the actual implementation of these "special" hashes (case-insensitive keys, read-only hashes, substring keys, whatever they come up with) is of little concern here, and can -- and has actually mostly been -- dealed with. The issue about performance came up, because, well, these operations may be called A LOT. So if there is any significant difference betweeen tied hashes (which map hash operators to OO-style methods, basically) and calling these methods directly, I would really like to know.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000398]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2014-04-17 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (439 votes), past polls