in reply to Stupid question about strings...
Hi, Kepler
Try switching your variables in the comparison, ie if ( $str2 =~ /$str1/i ){...
The other issue is that you have pipes at each end of $str1, which will probably interfere with the match (essentially allowing $str2 to always match), so you may want to do something about that (such as removing them, or escaping them, though that will also be problematic)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Stupid question about strings...
by ww (Archbishop) on Jul 14, 2014 at 10:49 UTC | |
by Laurent_R (Canon) on Jul 14, 2014 at 11:22 UTC | |
by ww (Archbishop) on Jul 14, 2014 at 16:54 UTC | |
by AnomalousMonk (Archbishop) on Jul 14, 2014 at 23:48 UTC | |
by Laurent_R (Canon) on Jul 15, 2014 at 08:26 UTC | |
by ww (Archbishop) on Jul 15, 2014 at 12:18 UTC | |
by Laurent_R (Canon) on Jul 15, 2014 at 17:42 UTC | |
|
Re^2: Stupid question about strings...
by Anonymous Monk on Jul 14, 2014 at 09:25 UTC | |
by SimonPratt (Friar) on Jul 14, 2014 at 14:14 UTC |