in reply to Re: Re: Re: Regexes loaded from file
in thread Regexes loaded from file

This is correct but not maximally efficient. Why create a separate sub for each s///? It's more efficient to just build one sub containing all the substitutions. Also, why localize and return $_? Operating on it directly is more efficient. See my solution below for an example of what I'm talking about.

-sam

  • Comment on Re: Re: Re: Re: Regexes loaded from file

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Regexes loaded from file
by Anonymous Monk on May 02, 2002 at 19:24 UTC
    I hadn't seen it. And I assumed that he only wanted to read regexes from a file. There it would be more usefull to have them separated. Of course your solution is better in the special situation the whole thread is about. However I read only the note to which I replied. So I chose the more general solution.