in reply to Re: Re: Randomly generating histograms
in thread Randomly generating histograms
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: •Re: Re: Re: Randomly generating histograms
by particle (Vicar) on Mar 27, 2002 at 00:45 UTC |