in reply to How to properly go through a WWW::Mechanize::Link object?

What Corion said. The @links are WWW::Mechanize::Link objects already–

use WWW::Mechanize; my $mech = WWW::Mechanize->new( autocheck => 0 ); $mech->get("https://perlmonks.org/?node=Recently+Active+Threads"); for my $link ( $mech->links ) { printf "* %s\n -> %s\n", $link->text, $link->url_abs; }

Replies are listed 'Best First'.
Re^2: How to properly go through a WWW::Mechanize::Link object?
by SergioQ (Scribe) on Apr 23, 2020 at 22:03 UTC

    First off, thank you. But this opens something that I've missed in Perl.

    What I was doing was:

    print "name\t\t$link->name\n";

    Which gave me:

    name WWW::Mechanize::Link=ARRAY(0x55bbd8e7d100)->name

    So what am I not understanding? Why does Perl not interpret this?