Help for this page

Select Code to Download


  1. or download this
        my %hash = ( BlueTeam => 8, RedTeam => 2, GreenTeam => 4 );
        my @sorted = sort { $hash{$b} <=> $hash{$a} } keys %hash;
    ...
        for my $team (@sorted) {
            print $team, " => ", $hash{$team}, "\n";
        }
    
  2. or download this
        printf "Largest is team %s: %d\n", $sorted[0],
            $hash{ $sorted[0] };