If Perl gives me the possiblity of using a 'nice' small solution (/foo|bar/) I always thought I should be able to program a faster solution with a perl PROGRAM ( the for loop ).
I wouldn't think that. At least, not if you're smart about language design. With good semantics, you provide the optimizer more information about what you're trying to do, thus allowing it to make better optimization. Unfortuately, Perl5 has hopelessly bad semantics, so this principle is mostly lost for us.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.