Re: sorting a hash by using a function

2002-11-03 Thread John W. Krahn
Roiy Zysman wrote: > > Hi All, Hello, > How can i get the hash reference when i use a function to sort that hash. > e.g. i want to sort the hash according to is values > I can do something like this > sort {$hash{$a} cmp $hash{$b}} (keys %hash); > but i want to sort it by using a call to a funct

sorting a hash by using a function

2002-11-03 Thread Zysman, Roiy
Hi All, How can i get the hash reference when i use a function to sort that hash. e.g. i want to sort the hash according to is values I can do something like this sort {$hash{$a} cmp $hash{$b}} (keys %hash); but i want to sort it by using a call to a function , something like this foreach my $item