in reply to Re: Re: Re: Regexp for alphbetical order match within the string
in thread Regexp for alphabetical order match within the string

Nice work! On my box, it was about 30% faster, and this subtle tweaking is about 25% faster, yet:
sub improved { my $lstr = lc shift; my ($p, $ntst) = (length($lstr)-1); chop($ntst = substr($lstr, $p, 2)) lt $ntst and return 0 while ($p--); 1; }
while this very similar model is actually slower
sub hobbled { my $str = lc shift; my ($p, $x) = (length($str)-1); chop($x) lt $x and return 0 while $x = substr($str, $p--, 2); 1; }