You are not checking the token type. You only want to check the starting 'a' tag.
#! c:\perl\bin -w use strict; use HTML::TokeParser; my $p = HTML::TokeParser->new(shift||die); while (my $token = $p->get_token) { print $token->[2]{'href'}, "\n" if ($token->[0] eq 'S' && $token->[1 +] eq 'a'); }
In reply to Re: HTML::Tokeparser and $attr problem
by Mr. Muskrat
in thread HTML::Tokeparser and $attr problem
by dannoura
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |