Link to home
Start Free TrialLog in
Avatar of sata
sata

asked on

Puzzle in sort

Hi,

I am not familiar with perl, and has came across this line for a sort

foreach $key (sort {$info{$b} <=> $info{$a}}keys(%info))
{

I was told that this is used to sort a hash list by using other fields that the key, how is it so?

Thanks in Advance.
Avatar of ozo
ozo
Flag of United States of America image

perldoc -f sort
perldoc -q sort
ASKER CERTIFIED SOLUTION
Avatar of guadalupe
guadalupe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sata
sata

ASKER

Thanks for the answer!!