use List::Util ‘shuffle‘;
my @list = (1..33);
my @blue = (1..16);
my $y = $#blue;
my $i=10;
while ($i>0){
@shuffled = shuffle(@list);
my @result = sort {$a <=> $b} (@shuffled[1..6]);
my $j = int rand ($y+1);
push @result,‘|‘;
push @result,$blue[$j];
print "@result\n";
$i--;
}本文出自 “至善至美” 博客,请务必保留此出处http://xiangjishi.blog.51cto.com/3505168/1389325
原文:http://xiangjishi.blog.51cto.com/3505168/1389325