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"
In reply to Re: confusing error >:(
by tobyink
in thread confusing error >:(
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |