Perl Monk, Perl Meditation | |
PerlMonks |
Re: "42" ~~ "42.0" is false in 5.10by syphilis (Archbishop) |
on Dec 24, 2007 at 13:17 UTC ( [id://658885]=note: print w/replies, xml ) | Need Help?? |
IMHO they should be compared as numbers but they are compared as strings Well ... they *are* both strings ... and you are doing nothing that dictates that those strings should be numified. The behaviour seems totally reasonable to me. OTOH, "42" * 1 ~~ "42.0" * 1 should (and does) evaluate as true - because, in this instance, something *is* being done to numify the strings. Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|