#!/usr/bin/perl -w open (LOG, ">>threadcheck.log") || &Error($!); $now = localtime; # "Thu Oct 13 04:54:34 1994" print LOG "Log Created on $now \r\n"; my $lines = 0; foreach $FILE (<*.c *.C *.cpp *.CPP *.h *.H>) { open (FIL, ">>$FILE") || die $!; print LOG "File $FILE was opened on $now \r\n"; while () { $lines++; my $brackets; foreach $word ( split ) { if ($word =~ '{' ) { print LOG "New open bracket \r\n"; $brackets++; } if ($word =~ '}' ) { print LOG "New closed bracket \r\n"; $brackets--; } print LOG "Number of unclosed brackets in file $FILE: $brackets\r\n"; } print LOG "Number of lines in file $FILE: $lines\r\n"; } close FIL } close LOG ##### #### while () { print FIL "/* I opened you on $now for bracket check*/ ... }