I'm not a mindreader. HTML::LinkExtor is a pretty mature module, and I doubt the interface should/will change.
You can certainly try to persuade the guy (perlsonally i'd rather just write HTML::LinkExtractor which would do all the things you say here, but would also extract the link text (stuff in between <a ..> </a> tags).
" One useful attribute of it being a hash would be to clobber incorrect HTML where a link had two HREFs. "
You don't have to worry about that (when in doubt, test).
use HTML::LinkExtor; my $p = new HTML::LinkExtor( sub { print "@_\n" }, ); $p->parse( q{ <a href="BUTTER" href="SCOTCH"> <img src="AND" src="PEANUTS"> }); __END__ a href SCOTCH img src PEANUTS
____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.
In reply to Re: Re: Re: Why Would HTML::LinkExtor return a hash of attributes?
by PodMaster
in thread Why Would HTML::LinkExtor return a hash of attributes?
by Cody Pendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |