{ open my $IN, '<', 'c:/temp/logbook.log' or die "cannot open datei: $!"; open my $FILE, '>', 'c:/temp/ok.txt' or die "Kann Datei 'c:/temp/ok.txt' nicht zum Schreiben oeffnen: $!"; say $FILE 'ok!' if scalar grep /error/, <$IN>; }