in reply to Weighting rand()
Rather than duplicating the array entries, I'd duplicate the indexes.
my $pick = ( (0)x3, (1)x4, (2)x4, (3)x5, (4)x6, (5)x6, (6)x6, (7)x6 )[ rand 40 ]; print $cgi->a({-href => "$mirrors[ $pick ]/$file-$stable.rpm", -title =>"$stable RPM"}, 'rpm');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Weighting rand()
by EdwardG (Vicar) on May 25, 2004 at 08:24 UTC | |
by BrowserUk (Patriarch) on May 25, 2004 at 08:42 UTC | |
by Abigail-II (Bishop) on May 25, 2004 at 09:10 UTC | |
by dave_the_m (Monsignor) on May 25, 2004 at 10:46 UTC | |
by BrowserUk (Patriarch) on May 25, 2004 at 11:30 UTC |