Help for this page

Select Code to Download


  1. or download this
    sort { 
         $a->{NAME} cmp $b->{NAME} # compare name (will return 0 if they a
    +re the same), using alphabetic order (cmp)
      or $a->{AGE} <=> $b->{AGE}   # compare age only if the names are equ
    +al, use numeric order (<=>)
    } @people;