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