i'd use map for a one liner to replace for:I wouldn't. This is clearer, faster, and one character shorter:map ++$array[rand $elements], 1..$sum;
Help stamp out void maps and greps!++$array[rand $elements] for 1..$sum;
-- Randal L. Schwartz, Perl hacker
In reply to •Re: Re: Re: Randomly generating histograms
by merlyn
in thread Randomly generating histograms
by narse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |