in reply to Use a hashref as a key in another hashref?
If you want to insist on continuing to use in-memory data structures to, in effect, represent database tables, then you will need to follow the same general design principles of third-normal form. For instance, a timestamp is an attribute of the data which, even though it may be thought of as “unique,” is not suitable for use as a key because it contains data. Instead, you need to assign each and every record an abstract foreign-key value ... in this confined case, an incrementing integer would do, since apparently the data is not stored ... and reference each record by the use of these keys. Where one record “refers to” another, a column in that table hashref in that object should contain the corresponding record’s key. (Circular storage references are thereby avoided.)
I recommend, further, that each type of record be declared as an object. Specifically so that “the data can ‘carry around its own transform functions,’ ” or, anything else that it needs to carry. A blessed-reference costs no more than an ordinary one.
A single hashref could contain a dictionary for all objects indiscriminately, and/or you could have a separate dictionary by type ... since the keys are in any case unique throughout the system, either or both alternatives would do as it suits you.
Having said all of that, however, I do suggest that this is an excellent application for an SQLite database disk file or in-memory file.