Perl HTML::Parser

apps

#1

When I run the script on the HTML::Parser documentation I get this error:
$ perl parser.pl
Undefined subroutine &main::start called at /usr/lib/perl5/HTML/Parser.pm line 104.

script:
use HTML::Parser ();

Create parser object

$p = HTML::Parser->new( api_version => 3,
start_h => [&start, “tagname, attr”],
end_h => [&end, “tagname”],
marked_sections => 1,
);

Parse document text chunk by chunk

$p->parse($chunk1);
$p->parse($chunk2);
#…
$p->eof; # signal end of document

Parse directly from file

$p->parse_file(“index.html”);

or

open(F, “index.html”) || die;

$p->parse_file(*F);

There are examples scripts that came with the module and some of them run while others do not. Do I need to ask Dreamhost to update the module or is there a way to have it use the modules in my ~/.cpan directory?

Or something else?