open(IN,'<'.$f) || die "Can not open file $datei: $!"; while(){ $n=$n+1; printf "$n.)$_"; if ($_ =~/$searchstring/i) { print "\nfound in $f\n" } else { #print "\nnot found $searchstring in $_\n" } } close IN;