Due to your use of rand 256 to generate the characters, your benchmark is heavily weighted towards non-matching instances. I've split each sub into matching and non-matching versions (comp required three non-matching versions).
I used rand to try and avoid the optimisation that I've read Perl will do to what is in effect a literal; but your method seems to take that into account.
It never ceases to amaze me how much you can learn here :-)
Pete
In reply to Re: Re: Testing a string for a range of characters
by BoredByPolitics
in thread Testing a string for a range of characters
by BoredByPolitics
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |