#!/usr/bin/perl
use strict;
use warnings;
use HTML::TableExtract;
die 'Missing argument!' unless (@ARGV);
my $file = shift @ARGV;
my $te = HTML::TableExtract->new();
$te->parse_file($file);
for my $table ($te->tables) {
print 'Table (', join(', ', $table->coords), "):\n";
my $rownumber = 1;
for my $row ($table->rows) {
print "Row $rownumber: ", join(', ', @$row), "\n";
$rownumber++;
}
}
####
my @total = @{ [ $all_table_content[0]->rows ]->[-1] };
print join(', ', @total), "\n";
####
my $table = ($te->tables)[0];
my $count = $table->rows;
my $last_row = $table->row($count - 1);
print join(', ', @$last_row), "\n";