Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- HTML::TreeBuilder & Data::Dumper
- Dean Karres
February 4, 2009, 7:54 pm
rate this thread
I have a few questions about HTML::TreeBuilder and I will ask them
here and in another message. First though, I am using
HTML::TreeBuilder to scan and harvest for info from local web pages.
I am having some issues debugging my script so I am trying to use
Data::Dumper to help me see the issue more clearly.
Ok, I use HTML::TreeBuilder and I do various things like:
if (! ($body = $tree->look_down('_tag', 'body')))
die "$ARGV is missing a BODY tag\n";
foreach $bodyElement ($body->content_list())
print STDOUT Dumper($bodyElement), "\n";
I was thinking that "$bodyElement" was the possible root of a sub-tree
of "$body". I assumed that Dumper would give me just that sub-tree.
Instead it is giving me all of "$tree" each time through the loop.
What am I missing?
- » HTML::TreeBuilder and Can't call method "look_down" without a package or object ref
- — Next thread in » PERL Modules Announcements