Don't ask to ask, just ask | |
PerlMonks |
Re: Infinity recognized as numberby shemp (Deacon) |
on Nov 22, 2002 at 18:08 UTC ( [id://215212]=note: print w/replies, xml ) | Need Help?? |
Nothing to do with infinify, rather a comment on perls numeric interpretation of scalars. using the addition operator "+", perl will use its numeric interpretation of both operands. 1 evaluates to 1 (like you'd expect) "Infinity" evaluates to 0 ("zero") so the addition results in 1 in general, when perl needs a numeric interpretation of a scalar, the value is the value of the maximal length numeric substring that starts at the first character of the scalar.
In Section
Seekers of Perl Wisdom
|
|