#!perl $true = 1; $false = 0; # usage statement $usage = "osm_check.pl *."; if (!exists $ARGV[0]) { print $usage; exit; } ($extension) = (split(/\./,$ARGV[0]))[1]; opendir($currentdir,"."); foreach $file (sort readdir($currentdir)) { ($e) = (split(/\./,$file))[1]; next if ($e ne $extension); # print "\n\n------------------",$file,"------------------\n"; open(F,$file); $l = 0; while() { chomp(); $line = $_; # remove leading white space $line =~ s/^\s+//; $l++; if (/osm_log\(/) { $ll = $l; while (!(/$\;/)) { $_ = (); chomp(); # remove leading white space s/^\s+//; $line .= $_; $l++; } # print $ll,"\t",$line,"\n\n\n"; # now separate the osm_log parameters $line = substr($line,index($line,"\(")+1); $line = substr($line,0,index($line,"\;")-1); ($log_type,$message)=(split(/\,/,$line))[1,2]; print "$file\t$ll\t$log_type\t$message\n"; } # if osm_log } # while () close(F); } closedir(currentdir);