#!/usr/bin/perl use strict; use warnings; use XML::LibXML; # This is a shortcut, see the docs for more formal usage. my $doc = XML::LibXML->new->parse_html_fh(*DATA); my $root = $doc->getDocumentElement; my ( $head ) = $root->findnodes("head"); my ( $body ) = $root->findnodes("body"); print "Head stuff...\n"; for my $refresh ( $head->findnodes('meta[@http-equiv]') ) { print "\t", $refresh->getAttribute("content"), "\n"; } print "\nBody stuff...\n"; for my $link ( $body->findnodes('a[@href]') ) { printf("%25s --> %s\n", $link->textContent || $link->getAttribute("title") || "n/a", $link->getAttribute("href") ); } # print $doc->serialize(1); __DATA__ PUT YOUR HTML DOCUMENT DOWN HERE. Took it out for space.