martin langhoff wrote:

> 
>         As a matter of fact, get_tag (in version 2.19) is only returning
> *opening* tags. Choose an arbitrary HTML file you have around, and
> you'll see that only opening tags are printed.

Goto http://www.perl.com and save the page as 'perl.com.html' then
try this:


use HTML::TokeParser;
require 'dumpvar.pl';


my $p = HTML::TokeParser->new('perl.com.html');

while(my $tag = $p->get_tag('/p')) {
    dumpValue(\$tag);
}
__END__

Here is what I get:
-> ARRAY(0x820afb0)
   0  '/p'
   1  '</P>'
-> ARRAY(0x820d870)
   0  '/p'
   1  '</P>'
-> ARRAY(0x820ae48)
   0  '/p'
   1  '</P>'
-> ARRAY(0x820ea40)
   0  '/p'
   1  '</P>'
-> ARRAY(0x820b0e8)
   0  '/p'
   1  '</P>'

get_tag gets the tag that you want. If you want 'p' tags then call $p->get_tag('p')
but if you want '/p' then call $p->get_tag('/p').

Works for me.


-Tim

Reply via email to