Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Moose 'clone' Constructor

by tobyink (Canon)
on Jul 05, 2018 at 08:29 UTC ( [id://1217933]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1217933]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-24 21:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found