Help for this page

Select Code to Download


  1. or download this
    mysort(\@list, 'age', 'asc', 'name', 'asc');
    
  2. or download this
    mysort(sub {  $_[0]{age}  <=> $_[1]{age}
               || $_[0]{name} cmp $_[1]{name} }, @list);
    
  3. or download this
    mysort {  $_[0]{age}  <=> $_[1]{age}
           || $_[0]{name} cmp $_[1]{name} } @list;