Tie::InsertOrderHash - insert-order-preserving tied hash
tie my %hash => 'Tie::InsertOrderHash', one_two => 'buckle my shoe', 3_4 => 'shut the door', V_VI => 'pick up sticks'; %hash{7_of_9} => 'not bad'; print "@{[keys %hash]}\n"; # prints keys in order inserted
Tie::InsertOrderHash is a tied hash which preserves the order of inserted keys. Regular perl hashes regurgitate keys in an unspecified order, but at times one wishes to have the properties of both a hash and an array.
As an extention, one may list key/value pairs as additional arguments to tie, as in the example above.
tie
None.
B. K. Oxley (binkley) <binkley@bigfoot.com>
Tie::Hash provides a skeletal implementation for a tied hash.
perldata explains more about hashes and arrays.
perltie explains more about tying hashes, and describes the internal subs used to implement them.
sub
tie explains more about how user code tie hashes and the implicit use of this module.
use
The DBI module is Copyright (c) 2002 B. K. Oxley (binkley). All rights reserved.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
To install Tie::InsertOrderHash, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tie::InsertOrderHash
CPAN shell
perl -MCPAN -e shell install Tie::InsertOrderHash
For more information on module installation, please visit the detailed CPAN module installation guide.