in reply to Extract HTML data

If I understood the question right, than, (from the docs):
# Shorthand...top level rows() method assumes the first table found i +n # the document if no arguments are supplied. foreach $row ($te->rows) { print join(',', @$row), "\n"; }
Then the answer might be:
use strict; use warnings; use HTML::TableExtract; use Data::Dumper; my $html_string = qq{ <html> <head> <title>test</title> </head> <body> <table> <tr><th>Name</th><th>Place</th><th>Country</th><th>Telephone</th></tr> <tr><td>Justin</td><td>California</td><td></td><td>12345</td></tr> <tr><td>Catherine</td><td>Texas</td><td>USA</td><td>2419422</td></tr> </table> </html> }; my $te = HTML::TableExtract->new( headers => ['Name', 'Place', 'Country', 'Telephone'], ); $te->parse($html_string); print Dumper($te->rows);

Replies are listed 'Best First'.
Re^2: Extract HTML data
by kalyanrajsista (Scribe) on Dec 11, 2009 at 11:11 UTC
    My intention is to retrieve the data directly as Array or Array's rather than 0th or 1st element (which itself is an array) of an array..