Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: Substring comparisonby JavaFan (Canon) |
on May 01, 2012 at 16:11 UTC ( [id://968292]=note: print w/replies, xml ) | Need Help?? |
Cleary 'FFF' is part of string 'FFF NNN JKK III LLL QQQ' and should return a result >= 0Indeed, and it does. However, the negation of result >= 0 is not if($result <= 0), which is what you wrote in your program. There is a value (0) that's both >= 0 and <= 0. Use if ($result == -1) in your program.
In Section
Seekers of Perl Wisdom
|
|