|Next||The Perl Hardware Store||DC.pm Version||58|
Hash keys must be strings
What if you want to associate some data with an object instead of with a string?
Use Tie::RefHash. Keys can be arbitrary references.
How does this work? It uses the unstringize trick.
Each hash is actually two hashes: One for keys, one for values.
Both are keyed by the stringized versions of the references
When it wants to figure out the object that it `stored' as a `key', it uses unstringize.
|Next||Copyright © 2003 M. J. Dominus|