Subject: | throws exception with 'use HTML::TableExtract();'. Patch included |
the *TREE trickery relies on the ->import method being called. when it
is not called, as in 'use HTML::TableExtract();', bad things happen.
patch includes a test case.
Subject: | html_tableextract_use.patch |
diff -Naur old/lib/HTML/TableExtract.pm new/lib/HTML/TableExtract.pm
--- old/lib/HTML/TableExtract.pm 2006-05-03 16:32:54.000000000 +1000
+++ new/lib/HTML/TableExtract.pm 2006-06-03 12:32:21.000000000 +1000
@@ -23,6 +23,10 @@
# default HTML::Parser. (use HTML::TableExtract qw(tree);) Also installs
# a mode constant TREE().
+BEGIN {
+ *TREE = sub { 0 };
+}
+
sub import {
my $class = shift;
no warnings;
diff -Naur old/t/10_bulk.t new/t/10_bulk.t
--- old/t/10_bulk.t 2006-06-03 12:35:44.000000000 +1000
+++ new/t/10_bulk.t 2006-06-03 12:46:52.000000000 +1000
@@ -10,7 +10,7 @@
my $file = "$Dat_Dir/ugly.html";
-use HTML::TableExtract;
+use HTML::TableExtract();
# by bulk, lineage integrity
my $label = 'by bulk with lineage check';