use HTML::TableExtract;
use feature qw/say/;
use strict;
use warnings;
my $file = 'temp.html';
my @headers1 = qw( Address Register 15 14 13 12 11 10 9 8 7 6 5 );
my @headers2 = qw( Address Register 15 14 13 12 11 10 9 8 7 6 );
sub try_match {
my ($headers_ref) = @_;
my $te = new HTML::TableExtract(
debug => 5,
headers => $headers_ref,
);
$te->parse_file($file);
my @tcount1 = $te->counts(0);
say "headers = @$headers_ref";
say "tcount1 = @tcount1";
foreach my $ts ($te->tables) {
print "Table (", join(',', $ts->coords), "):\n";
foreach my $row ($ts->rows) {
print join(',', @$row), "\n";
}
}
say "-" x 79;
}
try_match(\@headers1);
try_match(\@headers2);