use Perl Log In
Pseudo-hashes: Threat or Menace?
If you don't know what a pseudo-hash is, you're not alone. This little bastard of a data type was an attempt to merge the speed and compactness of arrays with the convenience of hashes and the fixed keysets of C-style structs. This was in May, 1997. Four years later and the bugs haven't been ironed out. The fundemental problems were presented in thePerl 6 RFC #241 "Pseudo-hashes must die!" advocating the elimination of this type from Perl 6 in favor of any number of better proposals for fixed-key hashes."
But this wasn't soon enough to get rid of the buggers. The question was asked of perl5-porters, "Must pseudo-hashes die?" proposing that the experiment be terminated in Perl 5 as well. The final nail in the coffin was the discovery that Pseudo-hashes drag on performance. The extra code to support pseudo-hashes slowed down all arrays and hashes by 10 to 15%. Much more important features have been killed for much less (safe signals were shelved for as little as 5% reduction in speed).
So pseudo-hashes are officially deprecated in 5.7.2 (and thus 5.8.0) and the current implementation will be purged completely from 5.10.0. Somethings will not be changing. The fields.pm module interface will remain, so if you have code which creates pseudo-hashes, switch over to fields.pm. Its not known yet what will replace pseudo-hashes, possibly something involving the new variable attributes, but there will be some way to have high-performance, fixed key hashes in 5.10.0. In the meantime, Tie::SecureHash is probably your best bet.