Help for this page

Select Code to Download


  1. or download this
    
    my @names_marks = ("cliff 76", "john 52", "keith 90", "rob 52");
    ...
    foreach my $key (sort {$b->[1] <=> $a->[1]} keys %hash) {
      print "\$key: $key \$value: $hash{$key}->[0] $hash{$key}->[1]\n";
    }
    
  2. or download this
    my @names_marks = ("cliff 76", "john 52", "keith 90", "rob 52");
    
    ...
                       map { [$_, (split(/ /, $_))[1] ] }
                       @names_marks;