Sorry, I have not been detailed enough.
it does detect the img tags, but somehow it does not seem to report them
to the callback function. observe:
==========
#!/usr/bin/perl -w
use HTML::LinkExtractor;
my $LX1 = HTML::LinkExtractor::->new( (
\&html_link_extractor_cb,undef,1) );
my $LX2 = HTML::LinkExtractor::->new( ( undef,undef,1) );
my $input = q{
<a href="http://www.foo.com"><img src="
http://www.bar.com/img.gif"></a>
};
print "with callback\n";
$LX1->parse(\ $input );
print "without callback\n";
$LX2->parse(\ $input );
use Data::Dumper;
my $links = $LX2->links;
local $Data::Dumper::Indent = 1;
warn Dumper( $links ),$/;
sub html_link_extractor_cb {
my( $X, $link ) = @_;
local $Data::Dumper::Indent = 1;
warn Dumper( $link ),$/;
}
===========
gives this output:
===========
with callback
$VAR1 = {
'_TEXT' => '[IMG]',
'href' => '
http://www.foo.com',
'tag' => 'a'
};
without callback
$VAR1 = [
{
'_TEXT' => '[IMG]',
'href' => '
http://www.foo.com',
'tag' => 'a'
},
{
'src' => '
http://www.bar.com/img.gif',
'tag' => 'img'
}
];
==================