use strict; use warnings; print "Kannst du schon Minusrechnen?\n"; my $ja_nein = ; if ($ja_nein =~ /ja/i) { $rechenfaehigkeit++; .... } else { ... my %rechenart = ( '+' => sub { $_[0] + $_[1] }, '-' => sub { $_[0] - $_[1] }, '*' => sub { $_[0] * $_[1] }, '/' => sub { $_[0] / $_[1] }, '**' => sub { $_[0] ** $_[1] }, ); my @zeichen = qw# + - * / ** #; my $anzahl_der_zeichen = @zeichen; .... while (1) { my $zahl1 = sprintf '%d', (int(rand($rechenfaehigkeit +1))); my $zahl2 = sprintf '%d', (int(rand($rechenfaehigkeit +1))); my $arrayindizies = ((int(rand( $anzahl_der_zeichen +1 ))) -1); my $welches_zeichen = $zeichen[$arrayindizies]; [b]Das ist die Zeile 98!!![/b] my $ergebnis = $rechenart{$welches_zeichen}->($zahl1, $zahl2); .... }