in reply to Interesting problem on perl data structure
You can test what a reference points to with ref, and test keys with either regexes or with the functions provided by Data::Types (is_string etc...). Data::Schema, once you get your head round it, can be used to ensure that a datastructure conforms to a particular 'look' or schema.
So if you have a general 'are they similar??' question then go for Data::Types and some kind of datastructure crawler, maybe in parallel on the two structures, but if you want to know if both conform to a particular structure then try Data::Schema. I guess it is up to you to define what you consider makes the structures 'similar'... HTH.
Update: SpAG...
|
|---|