- or download this
$n = scalar( split ',', $str );
print "$n\n";
- or download this
use strict;
use Benchmark qw/timethese cmpthese/;
...
my $n = scalar split ',', $str;
#print "$n\n";
}
- 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% --