#!/usr/bin/perl -w $html = html_test(); use HTML::TableExtract qw(tree); $te = HTML::TableExtract->new( headers => [qw(DESCRIPTION STOCK_NO)]); $te->parse($html); # $table = $te->first_table_found; # $table_tree = $table->tree; # $table_tree->cell(2,2)->replace_content('Test'); # $table_html = $table_tree->as_HTML; # $table_text = $table_tree->as_text; # $document_tree = $te->tree; # $html = $document_tree->as_HTML; print "Content-type: text/html\n\n".$html; sub html_test { return qq(
DESCRIPTION |
STOCK_NO |
1997-02 6 CYL 4.0L TJ WRANGLER | AEM-218300C |
1997-02 4 CYL 2.5L TJ WRANGLER | AEM-218301C |
2000-UP 6 CYL 3.7L KJ LIBERTY |
AEM-218302C |
1993-98 V8 (BOTH 5.2L& 5.9L) ZJ GRAND CHEROKEE | AEM-218303C |