{
package MyParser;
use base 'HTML::Parser';
sub start {
my($self, $tagname, $attr, $attrseq, $origtext) = @_;
if($tagname eq 'blockquote') {
$capturing{blockquote}=1;
$text{blockquote}="";
}
}
sub end {
my($self, $tagname, $origtext) = @_;
$capturing{blockquote}=0 if $tagname eq 'blockquote';
# Do whatever you want to do with $text{blockquote}
}
sub text {
my($self, $origtext, $is_cdata) = @_;
$text{blockquote}.=$origtext if $capturing{blockquote};
}
}
my $p = MyParser->new;
$p->parse_file("foo.html");