Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Overriding via a subclass?

by dchetlin (Friar)
on Sep 25, 2000 at 18:10 UTC ( [id://33910]=note: print w/replies, xml ) Need Help??


in reply to Overriding via a subclass?

You may have an old version of HTML::Parser. As of version 3, you do not have to subclass it to get interesting things to happen.

use HTML::Parser; my $parser = HTML::Parser::->new(api_version => 3); $parser->handler(text => sub { print "This is the text: $_[0]" }, "text"); $parser->parse($html_to_parse);

Subclassing can still be done, but there's rarely a reason to do it. This way is much more flexible.

-dlc

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://33910]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-19 11:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found