Here is the solution I've arrived at, thanks in part to username tjd:
#!/usr/bin/perl -ws
use HTML::Scrubber;
my $HTMLinput = do {local $/; <STDIN>};
my $scrubber = HTML::Scrubber->new( allow => [ qw[ table tr td ] ] );
print $scrubber->scrub($HTMLinput);
#test page: http://www.w3schools.com/html/html_tables.asp
#links -dump http://www.w3schools.com/html/html_tables.asp | html.table.parser.pl
#needed: "links" program for bash (sudo yum install links)
#http://www.jikos.cz/~mikulas/links/