Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^3: Equality operators

by ikegami (Pope)
on Apr 25, 2006 at 14:44 UTC ( #545569=note: print w/ replies, xml ) Need Help??

in reply to Re^2: Equality operators
in thread Equality operators

Others have already explained how the conversion works, but if you want to see for yourself the number into which a string is coerced, add 0 to the string.

print(0+'a', "\n"); # 0 print(0+'b', "\n"); # 0 print(0+'1', "\n"); # 1 print(0+'2', "\n"); # 2 print(0+'1foo', "\n"); # 1 print(0+'foo1', "\n"); # 0

Comment on Re^3: Equality operators
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2015-11-25 23:50 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (693 votes), past polls