The stupid question is the question not asked | |
PerlMonks |
Re^4: Regular expression match trouble with "+"by davorg (Chancellor) |
on Aug 17, 2006 at 10:00 UTC ( [id://567870]=note: print w/replies, xml ) | Need Help?? |
hi monk, try by replacing eq by '==' sign in if condition,it will work Are you suggesting code like this:
If so, that's some of the worst advice that I've seen on this site. The "==" operator works by converting its arguments to numbers and comparing those. In this case both of the strings will be converted to zero for the comparison, so they _will_ be equal. But there is a huge (effectively infinite) set of strings that are evaluated as zero when used as numbers. Most of these should not match in this case, but will with your code. Please be more careful with the advice you post here.
-- <http://dave.org.uk> "The first rule of Perl club is you do not talk about
Perl club."
In Section
Seekers of Perl Wisdom
|
|