for $pos ( sort { $song{$a}{VISITOR_POS} <=> $song{$b}{VISISTOR_POS} } keys %song ) { print "$pos $song{$pos}{VISITOR_POS} $song{$pos}{TITLE}\n"; }