/usr/share/doc/libhtml-parser-perl/examples
NameSizeModeActions
hanchors11960755editdlrm
hbody7290755editdlrm
hdisable7400755editdlrm
hdump7080755editdlrm
hform25020755editdlrm
hlc7170755editdlrm
hrefsub30680755editdlrm
hstrip17670755editdlrm
htext6120755editdlrm
htextsub9360755editdlrm
htitle4610755editdlrm
Edit: /usr/share/doc/libhtml-parser-perl/examples/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;