in reply to Re: Can Tie::IxHash be used to order elements in a list or hash of hashes?
in thread Can Tie::IxHash be used to order elements in a list or hash of hashes?

Explanation on the upshot.

Tie allows an object to masquerade as a native Perl data structure. Perl maps operations into method calls, and just makes the right method calls. The return value from tie is the object. It is just a regular object, some of whose methods have names that are special to Perl.

The data structure is what gets tied, and what that means is that it has been replaced by a sort of facade. Accessing an element might do anything. Amazing, astounding, unbelievable - until you realize that this is nothing more than making Perl's native data structures look like method calls. An idea which some languages take much, much farther and integrate much better than Perl does.

BTW you can get from the data structure to the object with tied. But the object knows nothing about the data structure that has been tied to it.

  • Comment on Re (tilly) 2: Can Tie::IxHash be used to order elements in a list or hash of hashes?