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

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

by biohisham (Priest)
on Jan 01, 2010 at 12:54 UTC ( #815181=note: print w/replies, xml ) Need Help??

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

Strings can look like 0 to the == operator and you can get into uncalled for hithces if you swap the string and numeric operators:
$apples = "apples"; $oranges = "oranges"; if($apples == $oranges){ print "$apples and $oranges are the same"; }else { print "$apples and $oranges are not the same"; }

Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://815181]
[chickenman]: Thank you, I am looking for enlightenment! ;)
[chickenman]: Unfortunatly no standard, Its the Output of some command
[Discipulus]: ouch! it outputs always same fields?
[harishnv]: Can someone give me a solution fast

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2018-02-20 08:19 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (268 votes). Check out past polls.