Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Simple adding numbersby nvivek (Vicar) |
on Mar 26, 2013 at 05:03 UTC ( [id://1025434]=note: print w/replies, xml ) | Need Help?? |
When I used lt instead of < operator, it works as you expected. Still, lt operator used for comparing strings not for numerals. As per my understanding, perl tries to implicitly convert both $i and 1 as strings and do comparison. If somebody finds different reason for it, kindly clarify me.
In Section
Seekers of Perl Wisdom
|
|