how to randomize List::Util::shuffle() better?

N

Nomen Nescio

I want to pick three things at random from a list, so:

use List::Util 'shuffle';

...

sub pick {
my @items = shuffle(@_);
return join(",", @items[0,1,2]);
}

but every time I call this (repeatedly within the same run) with the
same input list, I get the same three items back out.

Is there any way to randomize shuffle more?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top