Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Disadvantage of using 'eq' operator to compare numbers.

by JavaFan (Canon)
on Jan 01, 2010 at 14:20 UTC ( #815190=note: print w/ replies, xml ) Need Help??


in reply to Disadvantage of using 'eq' operator to compare numbers.

$_ = "Today is 01 Jan 2010"; my ($dayofmonth) = /(\d+)/; print $dayofmonth eq 1 ? "ok 1\n" : "not ok 1\n"; print $dayofmonth == 1 ? "ok 2\n" : "not ok 2\n"; __END__ not ok 1 ok 2


Comment on Re: Disadvantage of using 'eq' operator to compare numbers.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (21)
As of 2014-10-01 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (35 votes), past polls