in reply to What is the limit of random number that can be selected
Assuming your perl binary was compiled with enough RANDBITS and that you can store the entire array in memory, than yes, you can pull out a random element of the array.
For example, the following code generates an array with 100 elements in it, and retrieves the value of one element randomly selected:
my @a = map { rand(10) }(1..100); print $a[int(rand(100))]; __OUTPUT__ 4.65349565896584
You should be able to do something similar, except that your array would be bigger. Basically, the amount of memory would determine whether Perl could handle the process.
|
|---|