#!/usr/bin/perl -w use strict; use 5.010; use HTML::Treebuilder; #use HTML::TreeBuilder 5 -weak; # Ensure weak references in use my $site = "https://www.fourmilab.ch/yoursky/"; my $tree = HTML::TreeBuilder->new_from_url($site); $tree->parse_file($site); print "Hey, here's a dump of the parse tree of $site:\n"; $tree->dump; # a method we inherit from HTML::Element #print "And here it is, bizarrely rerendered as HTML:\n", $tree->as_HTML, "\n"; # Now that we're done with it, we must destroy it. $tree = $tree->delete; # Not required with weak references __END__