in reply to •Re: Selecting random records from an array
in thread Selecting random records from an array
my @subset = rand(75) <= 100, @input;
I think it works better with grep and the values swapped :)
Or just:my @subset = grep rand(100) < 75, @input;
my @subset = grep rand() < .75, @input;
Perhaps I misinterpreted your code, but in that case I have no idea what it is supposed to do.
Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: •Re: Selecting random records from an array
by halley (Prior) on Jun 04, 2003 at 13:48 UTC | |
by Juerd (Abbot) on Jun 04, 2003 at 15:38 UTC |