open(SRC, $srcFile) or die "can not open the src file";
open(DIST, ">$distFile") or die "can not open the dist file";
select DIST;
while(<SRC>){
if(/[ERROR|WARNING]/){
print $_;
}
$counter++;
}
print "there are $counter lines in the file\n";
close SRC;
close DIST;