#!/usr/bin/perl -w use strict; my $row; use HTML::TableExtract; $/ = ""; my $string = ; my $headers = ['Date of Incident','Date','Unit cost']; my $te = HTML::TableExtract->new(headers => $headers) ; $te->parse($string); # Examine all matching tables foreach my $ts ($te->table_states) { print "Table (", join(',', $ts->coords), "):\n"; foreach $row ($ts->rows) { print join(',', @$row), "\n"; } } # use Data::Dumper ; # print Dumper($te); __DATA__
Date Date of Incident Unit cost
11-19-2001 11-14-2001 .01
11-18-2001 11-14-2001 .01