Help for this page

Select Code to Download


  1. or download this
    $n =  scalar( split ',', $str );
    print "$n\n";
    
  2. or download this
    use strict;
    use Benchmark qw/timethese cmpthese/;
    ...
        my $n = scalar split ',', $str;
        #print "$n\n";
    }
    
  3. or download this
    Benchmark: timing 10000 iterations of split_anonymous, split_simple...
    
    ...
                     Rate split_anonymous    split_simple
    split_anonymous 525/s              --            -17%
    split_simple    634/s             21%              --