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"
|
|---|