I'm trying to write a screen scraper and I need to use inheritance
(according to a response to an earlier post). 

 

Here is the original piece of code:

 

  my $parser = HTML::Parser->new(api_version => 3);

 

Now how do I change this so it is creating an instance of my custom class?

 

Here is my attempt to make a new class:

 

package CrawlCompanyJobPage;

our @ISA = HTML::Parser;

sub new {

  my $invocant = shift;

  my $class = ref($invocant) || $invocant;

  my $self = {  @_ };

  bless($self, $class);

  return $self;

}

 

I don't think I have the ISA statement correct. 

 

How do I pass api_version=>3 along to my ancestor?

 

Thanks,

Siegfried

Reply via email to