#!/usr/bin/perl -w use strict; use XML::Twig; my $html_string = < Just a quick example

Example

an example

gotcha!

EOF my $t= XML::Twig->new->parse_html( $html_string); my $elem= $t->getElementById( 'test'); $elem->print;