in reply to Re: Challenge: fastest count of substring
in thread Challenge: fastest count of substring
$x =split /;/, $string means their are $x-1 ";" in string.
IMHO the only chance to get faster than now is to find an obscure feature in unpack.
example:
DB<103> $_="aXaXa" => "aXaXa" DB<104> $x=split /X/ => 3 DB<105> split /X/ => ("a", "a", "a")
ooops! 8-/
DB<106> $_="XaX" => "XaX" DB<107> $x=split /X/ => 2 DB<108> split /X/ => ("", "a")
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|