in reply to retrieving hash keys
If you can avoid that anyone writes to your hash directly instead of using the accessors of the class then it is relatively easy. You can either use a log or have the hash store not only the value but a serial number/sequence value (concatenated or in a HoH or HoA structure).
If not, you have to use 'tie' to add that functionality, i.e. tie that hash to methods that use an underlying data structure as suggested above, a log or a HashOfHashes with sequence values
Naturally you can't access the sequence numbers from the hash but from additional methods that access the underlying data structure
See 'perldoc -f tie' for more information
|
|---|