Use L<Hash::Util::FieldHash> or ties, depending
Under older perls this module provides a drop in compatible api to the
Hash::Util::FieldHash manpage using the perltie manpage. When the
Hash::Util::FieldHash manpage is available it will use that instead.
This way code requiring field hashes can benefit from fast, robust field
hashes on Perl 5.10 and newer, but still run on older perls that don't ship
with that module.
See the Hash::Util::FieldHash manpage for all the details of the API.