#!/usr/bin/perl use strict; use warnings; my @faf=(1,22); my @z=(1..49); for my $pos (sort{$b<=>$a}@faf) { splice(@z,($pos-1),1); } for my $cnt (1..12) { my @lotto=@z; splice(@lotto,int(rand($#lotto)+0.5),1) while(@lotto > (6-@faf) ); @lotto=sort{$a<=>$b}(@faf,@lotto); printf("Ziehung: %2d -> %s\n", $cnt, join(',',@lotto)); }