By call ing HTML::Parser's new(), you are creating a new object, not adding
the HTML::Parser information.  You also have to bless $self into something
before you can use "$self->" Use this instead:

sub new {
   my $proto = shift;
   my $class = ref( $proto ) || $proto;
   my $self   = bless {}, $class;

   $self -> SUPER::init(@_);
}
--
Mac :})
** I may forward private database questions to the DBI mail lists. **
----- Original Message -----
From: "KIMURA Takeshi" <[EMAIL PROTECTED]>
To: "Michael A. Chase" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, April 16, 2000 10:19 PM
Subject: Re: HTML::Parse overwriting sub parse


> I've added,
>
> sub new
> {
>     my( $self ) = shift;
>     $self->SUPER::new(@_);
> }
>
> and now it produces,
>
> # Usage: HTML::Parser::parse(self, chunk), <F> chunk 1.
>
> at
>
>     $self->SUPER::parse( $chunk );
>
> in 'sub parse' as my original message.
>
> I changed it to
>
>     $self->SUPER::parse( $self, $chunk );
>
> regarding the error message. But no change.
>
> Am I getting closer?
>
>
> Michael A. Chase wrote on 00.4.13 4:37 AM:
> >It looks like you'd still have to do some processing in your class's
new().
> >
> >If you look at HTML::Parser::new(), it calls HTML::Parser::init() to
> >actually install the pieces it needs.
> >
> >In your new(), you'd have something like:
> >
> >    my $self = bless {}, $class;
> >    # some stuff
> >    $self->init(@_);
> >    # more stuff
> >
> >This will add the hash elements to your class object that HTML::Parser
needs
> >and will parse any options it knows how to handle.  This assumes that
your
> >class is subclassed from HTML::Parser and neither your class nor any of
the
> >other parent classes that appear earlier in @YourClass::ISA (if any) have
an
> >init() method.


Reply via email to