in reply to Comparing strings case insensitive
The first is clearer and less error prone (woe unto you if $str2 ever contains metacharacters as is), but presuming a recent perl both should be equally speedy.
Update: Wow, I must have heard wrong about the re speedups or something; I thought that they supposedly had gotten optimized so fixed strings were on the same order as a vanilla comparison but as the benchmark below shows that's not the case. So yeah, definitely option one.
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Comparing strings case insensitive
by LesleyB (Friar) on Sep 12, 2008 at 21:26 UTC | |
by Fletch (Bishop) on Sep 12, 2008 at 21:39 UTC | |
by kyle (Abbot) on Sep 12, 2008 at 21:28 UTC |