"Matej Kovacic" <[EMAIL PROTECTED]> writes:

> I have the following problem. I have the database with HTML documents in
> each line. I want to extract all links from the HTML code.
> 
> So the program should look like this:
> 
> use HTML::Parser;
> use strict;
> 
> # open the file...
> 
> while(<FILE>)
> {
>   my $fullhtml= $_;
> 
>   my  @tags;
>   my $p=HTML::Parser->new(start_h=>[\@tags,"text"],
>        end_h=>[\@tags,"text"]);
>   $p->parse($fullhtml);

It would generally be a good idea to do a:

    $p->eof;

here.

>   @tags=map($_=$$_[0],@tags);
> 
>   print "TAGS: @tags\n";
> }
> 
> But @tags are empty!

I don't understand.  When I run this program @tags is not empty for
me.  Can you make a complete example with some sample data that fails.

Hint: If you use '@{text}' as argspecs instead of "text", then you
don't need the map statement to fix up @tags.  This requires
HTML-Parser-3.20 or better.

Regards,
Gisle

Reply via email to