SergioQ has asked for the wisdom of the Perl Monks concerning the following question:
And with the Dumper I can see all the data in there, including the parts I want (i.e. specific links). What I cannot figure out how to do is to cast those arrays in @links into individual WWW::Mechanize::Link objects and loop through them. I've tried nested foreach loops, but in the end I just come up with a mess. Each new array just has more arrays, and sometimes a hash reference that I can't dereference. I figure that there must be a proper way. Any hints would be appreciated. Thank youmy $mech = WWW::Mechanize->new(); $mech->get( $url ); my @links = $mech->links(); print Dumper (@links);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to properly go through a WWW::Mechanize::Link object?
by Corion (Patriarch) on Apr 23, 2020 at 06:14 UTC | |
|
Re: How to properly go through a WWW::Mechanize::Link object?
by Your Mother (Archbishop) on Apr 23, 2020 at 07:28 UTC | |
by SergioQ (Scribe) on Apr 23, 2020 at 22:03 UTC | |
by hippo (Archbishop) on Apr 23, 2020 at 22:16 UTC | |
|
Re: How to properly go through a WWW::Mechanize::Link object?
by marto (Cardinal) on Apr 23, 2020 at 07:32 UTC | |
|
Re: How to properly go through a WWW::Mechanize::Link object?
by choroba (Cardinal) on Apr 23, 2020 at 13:54 UTC |