[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] RFC: How can I optimise bulk matching regex



I'm currently working on a dictionary project, I'm using -
@searchterms= qw (
	term1
	term2
	term3
	...);

while (<>) {
    foreach $item(@searchterms) {
	if (/$item\/go) {
	    do stuff....;
	}
    }
}

-to parse the files I want to check - (the search terms array will get
bigger as the user dictionary expands). In the regexp faq it says this kind
of matching is very inefficient and suggest using  MAP to compile the
regexes, though I have tried I can't adapt the example given for what I
want to do, and the Camel is (unfortunately in this case) exactly like the
FAQ .
Any examples and/or pointers will go a long way to helping my insomnia

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org