#!/usr/bin/perl # Check for bare foreach $f (@ARGV) { open(INPUT, $f) || die "$f: $!"; $table = 0; while () { $l = $_; while ($l =~ s/<([^>]*)>//) { $html = $1; $table++ if $html =~ m:^table:i; $table-- if $html =~ m:^/table:i; if ($html =~ m:^td:i) { warn "$f\n" unless $table == 1; } } } }