++
Many thanks.
That shines a light on all the grey areas, including (from my earlier post):
"XYZ"->$x("fred")
being exactly equivalent to
$x->("XYZ", "fred")
| [reply] [d/l] [select] |
Assuming $x is a coderef, then yes, they're exactly equivalent. I don't think you can even detect the difference in the Perl OP tree.
But if $x is a string (containing a method name, optionally qualified with a package name), then $thing->$x("fred") will work if $thing is a package name (string) or a blessed object, but won't work otherwise.
| [reply] [d/l] [select] |