in reply to Random Picks

Load all the ss#'s into an array first, then pick randomly and load 1000 of them into another array. It is not that CPU consuming if you have only 2500 records.
The following code snippet will be useful:

$array[rand(@array)]

Be careful to not duplicate a pick. Maybe you could load the picks into a hash's key and investigate if you reached the required 1000 element or still under that.
Good luck!

--
tune

Replies are listed 'Best First'.
(tye)Re: Random Picks
by tye (Sage) on May 09, 2001 at 21:15 UTC

    To not duplicate a pick you do a Fisher-Yates shuffle and stop after N steps:

    my @ssn= getAllSSNs(); my $want= 1000; for( 0..$want-1 ) { my $choice= $want + rand(@ssn-$want); @ssn[$_,$choice]= @ssn[$choice,$_]; } return @ssn[0..$want-1];

            - tye (but my friends call me "Tye")