my $content = <hello?
hello?
hello?
hello?
HTML
use HTML::TokeParser;
my $parser = HTML::TokeParser->new( \$content );
my @links;
while ( my $token = $parser->get_tag(qw( a img )) ) {
my $link = $token->[1]{href} || $token->[1]{src} || next;
push @links, $link;
}
print "@links";