- for my $file (grep { -f "$dir/$_" and /\.php$/ } readdir $dh) {
- $file = "$dir/$file";
- open my $fh, '<', $file or die qq{Could not open "$file": $!\n};
- while (<$fh>) {
- if (/FORCE INDEX/ and $file !~ /Database\w*\.php/) {
- warn "Found FORCE INDEX string at line $. of $file\n";
- }
- if (/REPLACE INTO/ and $file !~ /Database\w*\.php/) {
- warn "Found REPLACE INTO string at line $. of $file\n";
- }
- if (/\bIF\s*\(/ and $file !~ /DatabaseMySQL\.php/) {
- warn "Found IF string at line $. of $file\n";
- }
- if (/\bCONCAT\b/ and $file !~ /Database\w*\.php/) {
- warn "Found CONCAT string at line $. of $file\n";
- }
+ my $file = shift;
+ open my $fh, '<', $file or die qq{Could not open "$file": $!\n};
+ while (<$fh>) {
+ if (/FORCE INDEX/ and $file !~ /Database\w*\.php/) {
+ warn "Found FORCE INDEX string at line $. of $file\n";
+ }
+ if (/REPLACE INTO/ and $file !~ /Database\w*\.php/) {
+ warn "Found REPLACE INTO string at line $. of $file\n";
+ }
+ if (/\bIF\s*\(/ and $file !~ /DatabaseMySQL\.php/) {
+ warn "Found IF string at line $. of $file\n";
+ }
+ if (/\bCONCAT\b/ and $file !~ /Database\w*\.php/) {
+ warn "Found CONCAT string at line $. of $file\n";
+ }
+ if (/\bGROUP\s+BY\s*\d\b/i and $file !~ /Database\w*\.php/) {
+ warn "Found GROUP BY # at line $. of $file\n";