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