in reply to Re: Pattern Matching With Regular Expressions
in thread Pattern Matching With Regular Expressions
Note the concatenation operator ".="$results{$number} .= "$url... @before <B>$1</B> @after <BR/>";
for $term ( @$inputs ) { while ( /\b$term\b/g ) { ... } }
BTW, please note the update I made in my earlier reply, about doing KWIC. I think other replies in this thread have explained about seeking to the beginning of the file, which is now a moot point. no longer relevant.
Another update, to answer your question about references: you're right, the input args are not being changed, but I'm suggesting that you pass two arrays to the sub: one is a list of files to search in, and the other is a list of terms to search for; using references to arrays allows you to pass both of these in one sub call -- if you don't use array refs, you're just passing an undifferentiated list, and the sub has no way of knowing where one array ends and the other begins. (whew! sorry about the mess!)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pattern Matching With Regular Expressions
by Anonymous Monk on Apr 13, 2004 at 05:01 UTC | |
by graff (Chancellor) on Apr 13, 2004 at 05:55 UTC | |
by Anonymous Monk on Apr 28, 2004 at 03:00 UTC | |
by graff (Chancellor) on Apr 28, 2004 at 03:50 UTC |