On 29 Mar 2005 10:19:09 -0800, Randal L. Schwartz wrote:
> 
> No, you should change it only when appropriate.  "35.0" is not eq to "35",
> and yet they are numerically equal.
> 

Dratz, foiled again! ;-)

> I hope you don't write the rest of your code like that. :(
> 

In this specific case I had no way to know what the OP has as data,
numbers or strings, so I assumed the general case. If you have strings
and use the "==" operator, you get warnings, no way around that (I'm
assuming "use warnings;" in effect). No only that, use also get a
wrong answer (e.g. "a" == "b" is TRUE).
If you use "eq" and are trying to find "35.0" when the string "35" is
the one you really want, and get a "no match" result, I would say that
is the correct behaviour and the "no match" result is actually
correct, or at least less wrong, since if you have both strings and
numbers I see no way to use "==" for comparison without getting false
results. Am I right?

Regards,
-- 
Offer Kaye

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to