#!/usr/bin/perl -w use strict; use LWP::Simple qw(get); use HTML::Parser; my $parser = Example->new(); my $html = get("http://www.perlmonks.org") or die "Cannot fetch the HTML\n"; $parser->parse($html); package Example; use base qw(HTML::Parser); sub text { my ($self,$text) = @_; print $text; }