http://www.perlmonks.org?node_id=953665


in reply to Very Large Arrays

Not directly related to you problem, but Perl comes with a built in shuffle.
use List::Util 'shuffle'; my @A = qw- 1 2 3 4 -; @A = shuffle @A; say "@A";