[Israel.pm] run many regexes

Shmuel Fomberg semuelf at 012.net.il
Fri May 2 17:26:26 EEST 2008


Pinkhas Nisanov wrote:

>>  Precompile your regexps with qr// and store the results in a wide
>>  enough scope that you don't recompute them.
> 
> sure, I precompile my regexes ( qr// ) and store them in array,
> then map this array on content string.

So, all the regexes are executed before you have a chance to decide 
pass/fail.
Isn't it better to run them one by one and break if one of them fails?

Shmuel.


More information about the Perl mailing list