in reply to confusing error >:(

This:

$link->url

... is a method call. Method calls don't interpolate in double-quoted strings. Try:

my @links = $mechObject->links(); foreach my $link (@links) { print $link->url; }

Aside: there is actually a special trick for getting method calls (in fact, arbitrary code) to interpolate in strings though:

print "Here it is: @{[ $link->url ]}!\n"
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'