# --------- Konfigurationsbereich ----------------
# Anzahl der Zufallszahlen
my $count = 6;

# Obergrenze der Zufallszahlen (Lottozahlen)
my $Maximum = 49;
# ------------------------------------------------

my %zahlen = ();

srand(time ^ $$);

for(my $i = 1; $i <= $count; $i++)
  {
  print ZufallsZahl($Maximum), "\n";
  }

sub ZufallsZahl #($top)
  {
  my $top = shift;
  my $zahl;
  
  do # solange ziehen, bis eine "neue" Zahl gefunden wurde
    {
	$zahl = int(rand($top) + 1);
	}
  while (exists($zahlen{$zahl}));
  $zahlen{$zahl} = 1;
  return $zahl;
  }