in reply to Re^3: Moose 'clone' Constructor
in thread Moose 'clone' Constructor

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

— Ken

Replies are listed 'Best First'.
Re^5: Moose 'clone' Constructor
by tobyink (Canon) on Jul 05, 2018 at 17:11 UTC

    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.