in reply to RE: Re: Faster way?
in thread Faster way?

/$search_pattern/ is unanchored:
"abcdefg" =~ /cd/ # true "abcdefg" =~ /^cd/ # anchored at start, false "abcdefg" =~ /fg$/ # anchored at end, true
The regular expression I provided will match anywhere in the line, unless you've modified that behavior by inserting a ^ or $ at the beginning of the search string, or the end, respectively.

Replies are listed 'Best First'.
RE: RE: RE: Re: Faster way?
by the_slycer (Chaplain) on Oct 06, 2000 at 23:37 UTC
    Thanks for that :-)
    The code from above seems to not do much for speed improvement though, obviously cleaner, but not much faster. Damned w2k.. all of these are out on a file server for shared access. I run this same code on my linux box, and way way faster. Too bad :(
      Moving your open and close calls outside of your loop will definitely speed things up. Check the comments in my original post for other speed-ups.