in reply to Which is better when doing a simple match?

eq is always best, if you can use it. It's the simpler method. Doing a regex has to load a lot more schtuff.

Now, if you had to do a regex, it would be much better if you did ($thing =~ /^thing$/), because that's equivalent to ($thing eq 'thing').

------
/me wants to be the brightest bulb in the chandelier!

Vote paco for President!

Replies are listed 'Best First'.
Re: Re: Which is better when doing a simple match?
by mr.dunstan (Monk) on Aug 21, 2001 at 23:44 UTC
    So you're saying eq is always faster ... ?

    -mr.dunstan
      It is always at least as fast. Why are you asking - do you have a counterexample?

      ------
      /me wants to be the brightest bulb in the chandelier!

      Vote paco for President!