use List::Util qw( shuffle ); my @list = shuffle 0 .. 51; # shuffle the deck of cards