Help for this page

Select Code to Download


  1. or download this
    @sorted = sort { substr($a, 1) <=> substr($b, 1) } @data
    
  2. or download this
    use Sort::Key::Multi qw(si_keysort);
      # "si" indicates that the sorting keys
      # are a string and an integer
    
    my @sorted = si_keysort { /^(\D*)(\d*)$/ } @data;