...the index is implicitly converted before being used.
...and it does so via truncation:
as opposed to rounding, and that's why it works so well in $arr[rand @arr].% perl -le 'print +(0, 1)[0.999999]' 0
the lowliest monk
In reply to Re^3: Randomly picking numbers
by tlm
in thread Randomly picking numbers
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |