Help for this page

Select Code to Download


  1. or download this
    %health = (
        'John Kay' => [151,128],
        'Sally Gi' => [174,145],
    );
    
  2. or download this
    while ( my ($patient,$levels) = each %health ) {
        my @ascending = sort {$a <=> $b} @$levels;
    ...
        my @descending = sort {$b <=> $a} @$levels;
        print "$patient: @descending\n";
    }
    
  3. or download this
    John Kay: 128 151
    Sally Gi: 145 174
    
    John Kay: 151 128
    Sally Gi: 174 145