Help for this page

Select Code to Download


  1. or download this
    use strict;
    my @x = qw( 1xxx  2xxx 300x  10xx  );
    ...
    
    print "numeric sort: @x\n";
    
  2. or download this
    
    @x = sort {$a =~/^d+/ <=> $b =~/^d+/} @x;
    
    print "regex sort: @x\n";