Stephen Hildrey <> wrote in message
news:...
> DVH wrote:
> > I'm trying to get tokeparser to fetch a series of hyperlinks and print
the
> > URL followed by the link text.
> >
> > The following script ("eurofeed.pl") gives me "Can't coerce array into
hash
> > at eurofeed.pl line 31"
> >
> > Line 31 is "if ($tag->[2]{class} and $tag->[2]{class} eq
'docSel-titleLink')
>
> You probably want ->[1] rather than ->[2]
I did. I had thought it would be tag[2] because I was looking for the third
tag within those brackets, but obviously not.
Thank you, that now works. I have a couple more questions (ah they always
do...)
Firstly, the HTML puts a lot of whitespace in the middle of the hrefs. Is
there a reasonably simple way of getting rid of that? The site is at
http://europa.eu.int/rapid/recentPre...guage=en&hits=
10 if you need to see it.
Secondly, I'm working towards getting following those hrefs and then parsing
the text I find there. Would I be better off using WWW::Mechanize to do
this?
Thanks again for your help.