Jason Dusek wrote:
>
> What is good way to pull the href from a link in html? If I have links like:
>
> meow woof moo bark bahh <a href="here_kitty" class="domestic">meow</a>
> bahh moo bark
>
> How do I pull just the 'here_kitty' part?
Hi Jason.
For something simple like this HTML::SimpleLinkExtor is ideal.
The program below should help.
Rob
use strict;
use warnings;
use HTML::SimpleLinkExtor;
my $html = q{
meow woof moo bark bahh <a href="here_kitty" class="domestic">meow</a>
bahh moo bark
};
my $extor = HTML::SimpleLinkExtor->new;
$extor->parse($html);
print "$_\n"foreach $extor->links;
**OUTPUT
here_kitty
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>