Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Re^3: Regular expression match trouble with "+"
in thread Regular expression match trouble with "+"

hi monk, try by replacing eq by '==' sign in if condition,it will work

Are you suggesting code like this:

$a = "I have to get the + version"; $b = "I have to get the + version"; if ($a == $b) { print "Ok\n"; } else { print "Not the same...\n"; }

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."
-- Chip Salzenberg

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://567870]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-23 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found