#/usr/bin/perl use strct; use warnings; my $chuncksize=10*1024*1024; # 10MB je größer je schneller my $file='C:\myfile.txt'; my $regexp=qx/CP_NG/o; open(TRACEFILE, '<', $file ) or die "cannot open $file $!\n"; my $found=0; my $chunk; while (read(TRACEFILE, $chunk, $chuncksize)) { $found += $chunk =~ m/$regexp/g; } print "anzahl treffer: $found\n";