in reply to Re: Re: Why Would HTML::LinkExtor return a hash of attributes?
in thread Why Would HTML::LinkExtor return a hash of attributes?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Why Would HTML::LinkExtor return a hash of attributes?
by Cody Pendant (Prior) on Aug 19, 2002 at 23:52 UTC |