I have a hash of hashes that I maintain in a module that lives within a software configuration management system (ClearCase, but that is of no real import). I use the hash as a simple statistics database. A statistics collection and publishing script...
What I (think I) want is to tie *all* the hashes in the hash of hashes so that they are always retrieved sorted, so that the output from Data::Dumper is always consistent. This would, I believe, allow the output of a diff against the previous version of a module file to consistently report accurate results.
Is there any easy way to declare that all the nested hashes in a structure will be sorted? BTW, I don't care one whit about the sort comparison subs - I just want consistency in the output. I am not that familiar with this kind of problem (nor really deeply with ties). Please also note that I do want to continue to maintain the hash as an entity declared and defined purely by the text within the module, if possible. I don't want to serialize it via some external database (using Storable or some such), since doing so would prevent module version diffs from being useful.
One other question - upon an eval of the stringified (by Data::Dumper) hash will the hashes be re-tied automagically or do I have to handle that myself somehow?
Conceptual guidance will be very appreciated. I can probably figure a reasonably acceptable approach myself, but I'd like to know the best and easiest way to do this.
In reply to Sort-Tying all hashes in a hash of hashes by welchavw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |