/usr/share/doc/perl-HTML-Parser/eg
NameSizeModeActions
hanchors11960644editdlrm
hbody7290644editdlrm
hdisable7400644editdlrm
hdump7080644editdlrm
hform25020644editdlrm
hlc7170644editdlrm
hrefsub30680644editdlrm
hstrip17670644editdlrm
htext6120644editdlrm
htextsub9360644editdlrm
htitle4610644editdlrm
Edit: /usr/share/doc/perl-HTML-Parser/eg/hbody (729B)
#!/usr/bin/perl use strict; use warnings; use HTML::Parser (); my $doc = <<'EOT'; foo Howdy! EOT my $body_offset; HTML::Parser->new( start_h => [ sub { return unless shift eq "body"; $body_offset = shift; shift->eof; # tell the parser to stop }, "tagname,offset,self" ] )->parse($doc); die "No found" unless defined $body_offset; my $head = substr($doc, 0, $body_offset, ""); print $doc;