> -----Original Message-----
> From: Michael Kelly [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 06, 2001 1:38 PM
> To: [EMAIL PROTECTED]
> Subject: Re: == vs eq What's the difference?
>
> ...
> To elaborate, all strings have a numerical value of 0.
Ouch! need to clarify that a bit.
When comparing with the numeric operators, Perl converts strings to numbers
using something like the atof(3) function (maybe it actually uses atof(),
I'm not sure). So the numeric value of a string is determined by skipping
any leading whitespace and examining characters until the first unrecognized
character is found. If no characters that look like a number are found, 0 is
returned.
The following numeric comparisons are all TRUE:
"123" == 123
" 123" == 123
"123.0" == 123
"1.23E2" == 123
"123 Main Street" == 123
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]