Tie::Hash::Longest - A hash which knows its longest key and value
tie my %hash, 'Tie::Hash::Longest';
%hash = (
a => 'ant',
b => 'bear',
elephant => 'e'
# prints elephant
# prints bear
This module implements a hash which remembers its longest key and value. It avoids rescanning the entire hash whenever possible.
The following methods are available. Call them thus:
Return the longest key.
Return the longest value.
David Cantrell <email@example.com>. I welcome feedback.
Copyright 2001 David Cantrell.
This module is licensed under the same terms as perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Tie::Hash::Longest, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.