my $tree = HTML::TreeBuilder->new; # empty tree $tree->parse( $res->content ); $tree->eof; # tells it to parse the whole thing # Straight content dump $tree->dump; # HTML-formatted print $tree->as_HTML; # Just the text print $tree->as_trimmed_text; # Cleanup the tree $tree->delete;