Don't you mean
$product *= $_ for 1..$number;
rather than
$product *= $number for 1..$number;
And in this case, you can start at 2:
$product *= $_ for 2..$number;
In reply to Re^2: back iffing with for?
by ikegami
in thread back iffing with for?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |