Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Action at a distance

by karlgoethebier (Abbot)
on Nov 03, 2022 at 19:26 UTC ( [id://11147953]=note: print w/replies, xml ) Need Help??


in reply to Re: Action at a distance
in thread Action at a distance

"To avoid getting bit by this…"

BTW, what prevents me from doing something like this?

package Acme; use parent 'Clone'; …

And later:

my $object = Acme->new; my $copy = $object->clone;

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re^3: Action at a distance
by LanX (Saint) on Nov 03, 2022 at 19:49 UTC
    > BTW, what prevents me from doing something like this?

    Nothing.

    You can always do it explicitly, as long as a ->clone method is available.

    But the OP wants this to happen implicitly, when he does my $copy = $magic_object;

    Cheers Rolf
    (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-25 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found