#!/usr/bin/perl use HTML::TreeBuilder::XPath; use strict; use warnings; my $root = HTML::TreeBuilder::XPath->new; $root->parse_file(\*DATA); $root->eof(); for my $d ($root->findnodes('//html/head/meta[@name="description"]/@content')) { print qq(D=\n); print $d->as_text; } $root->delete; exit(0); __DATA__

FOO

Bar