Date: 2009-04-27 22:23
Sender: Jeff Rickard
Here is a Perl script you can run in order to identify all the
changes:
#!/usr/bin/perl
@directories = split(/\n\n/, `ls -R1`);
my @filelist;
my $changeCount, $fileCount;
foreach $directory (@directories) {
my @files = split(/\n/, $directory);
my $dirname = shift(@files);
$dirname =~ s/://;
foreach $file (@files) {
#if ($file =~ /rb$/) {
push(@filelist, "$dirname/$file");
#}
}
}
foreach $file (@filelist) {
open(INF, $file);
@lines = <INF>;
close(INF);
my $formCount = 0;
my $lineNumber = 0;
my $changeCheck = 0;
foreach $line (@lines) {
$lineNumber++;
if ($line =~ /\<form/) {
$formCount++;
}
if ($line =~ /\<\/form/) {
$formCount--;
}
if ($formCount > 0) {
if ($line =~ /<label/) {
$changeCount++;
$changeCheck = 1;
print "$file ($lineNumber): $line";
}
}
}
if ($changeCheck == 1) {
$fileCount++;
}
}
print "\nThere are $changeCount changes required in $fileCount
files (searched " . scalar(@filelist) . "
files)\n";
|