substr and chop do only one thing, which means they're much faster than regex engine
Also while...=~/(.)/g; is fastest written as for split '',...;,
For a sea of benchmarks/topic/"explanations" about these tricks see Re: How to make this substitutions without splitting the strings? (compute not reckon)
In reply to Re^3: Weighted frequency of characters in an array of strings
by Anonymous Monk
in thread Weighted frequency of characters in an array of strings
by K_Edw
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |