Help for this page

Select Code to Download


  1. or download this
    split /(\d+)/
    
  2. or download this
    sub natcomp {
        my @a = split /(\d+)/, $a;
    ...
        }
        return scalar @a <=> scalar @b;  # shortest array comes first
    }
    
  3. or download this
    chomp(my @array = <DATA>);
    $\ = "\n";
    ...
    Chapter 1 Section 3
    Chapter 10 Section 2
    Chapter 2 Section 1