coldfingertips has asked for the wisdom of the Perl Monks concerning the following question:

I asked this in the chatterbox and got a couple replies but I didn't come up with a solution. Can anyone show me how I can get an array of links using www::mechanize?

I tried

my @links = $mech->find_all_links();
But it drops "WWW::Mechanize::Link=ARRAY(0x88c7b08)" which is obviously a reference instead of the actual data. I'm not too familiar with references, I've made it this far without ever really have to use many of them. Can someone show me an example of how to get back all the links into an array?

Replies are listed 'Best First'.
Re: Fetching links with www::mechanize
by Joost (Canon) on Apr 06, 2007 at 14:55 UTC
Re: Fetching links with www::mechanize
by Corion (Patriarch) on Apr 06, 2007 at 14:56 UTC

    As the documentation tells you, the ->find_all_links method returns all links as WWW::Mechanize::Link objects. You can then just call the appropriate methods on these objects to retrieve the information.