#!/usr/bin/perl $durchgaenge=0; while ($durchgaenge<($#loesung_array+1)) { $zahl=0+rand(3); print"Translate the word $vokabeln_array[$zahl]\n"; $eingabe = ; chomp $eingabe; if ($eingabe eq $loesung_array[$zahl]) { print"The translation is correct!\n"; $durchgaenge++; } else { print"The translation is incorrect\n"; print"Do you want to save the incorrect word and answer?\n"; print"(1)Yes (2)No\n"; $antwort=; chomp$antwort; if($antwort eq 1){ print"Please tell me a name how you want to save the wrong answer:\n"; $name=; chomp$name; open(SCHREIB,">nichtgekonnte.txt"); print SCHREIB ">$name\n"; print SCHREIB $eingabe; close(SCHREIB); $durchgaenge++; } else{ $durchgaenge++; } } } exit;