Thanks Rolf,
Since it's a classic hopefully it at least brought a sense of nostalgia for you. ;)
What you said regarding the key being stringified and references possibly being lost to garbage collection makes sense.
My hope was to be able to traverse the hash and search for specific values in the "key hash" to determine whether I want the stats or not. Searching through a separate hash wherein I store the "keys" doesn't appeal to me much but I will test it as an option. Right now I'm reconsidering the idea of each "data set" having it's own key constructor and destructor subs that just ride around in the data structure with it. I could effectively have a sub that takes a search value and determines if it's part of the key similar a hash -- though I'm sure not as fast. For example
#imagine the config was loaded from a YAML file my $string_search_function = $config->{'string_search_function'}; if(&{ $string_search_function }($key_string, $key_component_label, $va +lue_to_search_for)){ #do something interesting }
Thanks again for your thoughts!
In reply to Re^2: Use a hashref as a key in another hashref?
by mwb613
in thread Use a hashref as a key in another hashref?
by mwb613
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |