in reply to Table.pm: Extract text from html tables

Is there an error in the Table.pm code?

It seems that to get a "table" object to succeed in being populated with html table contents required a change to Table.pm.

It was necessary to replace the line "return 1;" in "parse_it" with "return $table;" in order for the "example.pl" script to function correctly.

Here's the "example.pl" script;

#!/bin/perl use table; $filename = Some html file ; my $table = Table->parse_it($filename); for $x (1 .. $#$table) { print "table $x contents:\n"; for $y (1 .. $#{$table->[$x]}) { for $z (1 .. $#{$table->[$x][$y]}) { print "cell($y,$z)-->\"$table->[$x][$y][$z]\"\n"; } } print "\n\n"; }

Replies are listed 'Best First'.
Re^2: Table.pm: Extract text from html tables
by Anonymous Monk on May 01, 2010 at 03:57 UTC
    Is there an error in the Table.pm code?

    I don't know, but since you have use table; the problem is with your code, since Table ne table