P is for Practical | |
PerlMonks |
Re: if condition only returns false . . .by ton (Friar) |
on Apr 05, 2001 at 04:15 UTC ( [id://69953]=note: print w/replies, xml ) | Need Help?? |
rand returns a floating point number between 0 and 1. The int operator takes the integer portion of that number, which will always be zero for numbers in the range [0, 1). Hence, always false!
In Section
Seekers of Perl Wisdom
|
|