Tie::Hash::SortedTie::Hash::Sorted Perl module presents hashes in sorted order. | |
Download |
Tie::Hash::Sorted Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Joshua Gatcomb
- Publisher web site:
- http://search.cpan.org/~jgatcomb/Tie-Hash-Sorted-0.10/Sorted.pm
Tie::Hash::Sorted Tags
Tie::Hash::Sorted Description
Tie::Hash::Sorted Perl module presents hashes in sorted order. Tie::Hash::Sorted Perl module presents hashes in sorted order.SYNOPSIS use Tie::Hash::Sorted; my %ages = ( 'John' => 33, 'Jacob' => 29, 'Jingle' => 15, 'Heimer' => 48, 'Smitz' => 12, ); my $sort_by_numeric_value = sub { my $hash = shift; ; }; tie my %sorted_ages, 'Tie::Hash::Sorted', 'Hash' => %ages, 'Sort_Routine' => $sort_by_numeric_value; for my $name ( keys %sorted_ages ) { print "$name is $sorted_ages{$name} years old.n"; } ### OUTPUT ### Heimer is 48 ears old. John is 33 ears old. Jacob is 29 ears old. Jingle is 15 ears old. Smitz is 12 ears old. Requirements: · Perl
Tie::Hash::Sorted Related Software