in reply to Multiple regex catches on a line
In using if, you're only calling the regexp once per line. Change it to this:
while (<file>) { while (/(regex1|regex2|regex3)/gi) { f($1); } }
Update: Added the 'g' modifier. Thanks to Hofmator for keen eyes.
stephen
|
|---|