remove WebGUI::Utility::sortHashDescending

This commit is contained in:
Graham Knop 2010-08-20 12:44:40 -05:00
parent c1132e4298
commit a0a26da3bc
2 changed files with 1 additions and 26 deletions

View file

@ -23,7 +23,7 @@ use Net::CIDR::Lite;
our @ISA = qw(Exporter);
our @EXPORT = qw(&isInSubnet
&sortHashDescending &sortHash &isIn &randint &round &scalarEquals
&sortHash &isIn &randint &round &scalarEquals
);
@ -43,7 +43,6 @@ This package provides miscellaneous but useful utilities to the WebGUI programme
$integer = randint($low,$high);
$rounded = round($number, $digits);
%hash = sortHash(%hash);
%hash = sortHashDescending(%hash);
=head1 METHODS
@ -211,27 +210,5 @@ sub sortHash {
return %newHash;
}
#-------------------------------------------------------------------
=head2 sortHashDescending ( hash )
Sorts a hash in decending order by its values. Returns a Tie::IxHash.
You must assign this to a similarly tied hash to preserve the order.
=head3 hash
A hash to be sorted.
=cut
sub sortHashDescending {
my %hash = @_;
tie my %newHash, 'Tie::IxHash';
for my $key ( sort { $hash{$b} cmp $hash{$a} } keys %hash ) {
$newHash{ $key } = $hash{ $key };
}
return %newHash;
}
1;