15.3. Pseudohashes
Pseudohashes were a mistake. Their goalbetter compile-time type-checking, leading to comparatively faster run-time accesswas entirely laudable. But they achieved that goal by actually slowing down all normal hash and array accesses. They can also double both the memory footprint and the access-time for objects, unless they're used in exactly the right way. They're particularly inefficient if you ever forget to give their container variables a type (which is pretty much guaranteed, since you never have to give any other Perl variable a type, so you're not in the habit). Pseudohashes are also prone to very hard-to-fathom errors when used in inheritance hierarchies[*].
Don't use them. If you're currently using them, plan to remove them from your code. They don't work with Perl releases prior to Perl 5.005, they're deprecated in Perl 5.8, and will be removed from the language entirely in 5.10. |