use strict; use warnings; open (READFILE, ") { if ($_ =~ /\d+/) { print "Digit gefunden: $_\n"; } elsif ($_ =~ /\w+/) { if ($_ =~ /EndOfFile/) { print "Du hast das Fileende erreicht erreicht!Exiting...\n"; close (READFILE); exit 1; } else { print "String gefunden: $_\n"; } } }