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

Try the section "Method Call Variations" in perlobj.

Replies are listed 'Best First'.
Re^4: Moose 'clone' Constructor
by kcott (Archbishop) on Jul 05, 2018 at 08:51 UTC

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

      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.