use warnings; use strict; use List::Util qw(shuffle); for ((shuffle(1..20))[0..9]) { print "$_\n"; }