MakeMe...e::Ref(3pm)
π¦ NAME π¦
Class::MakeMethods::Template::Ref β Universal copy and compare methods.
Okay bestie, this page is MakeMe...e::Ref(3pm) from User Contributed Perl Documentation, and it is literally here to give you copy and compare methods. π
β¨ SYNOPSIS β¨
No cap, the whole setup is right here:
package MyObject;
use Class::MakeMethods::Template::Ref (
'Hash:new' => [ 'new' ],
clone => [ 'clone' ]
);
package main;
my $obj = MyObject->new( foo => ["Foozle", "Bozzle"] );
my $clone = $obj->clone();
print $obj->{'foo'}[1];
π DESCRIPTION π
The following types of methods are provided via the Class::MakeMethods interface:
π«Ά clone
Produces a deep copy of an instance of almost any underlying datatype. Itβs giving βsame energy, new objectβ β¨
Parameters:
init_methodβ if defined, this method is called on the new object with any arguments passed in. π
πΈ prototype
Creates new instances by making a deep copy of a static prototypical instance. Prototype says βhereβs the blueprint,β and you get a fresh copy. π
Parameters:
init_methodβ if defined, this method is called on the new object with any arguments passed in. π«Ά
π₯ compare
Compare one object to another. Main character energy: βwho even are you?β π
π Templates
defaultβ Three-way (sorting-style) comparison.equalsβ Are these two objects equivalent?identityβ Are these two references to the exact same object?
π SEE ALSO π
- See
Class::MakeMethodsfor general information about this distribution. π - See
Class::MakeMethods::Templatefor more about this family of subclasses. π§ - See
Class::MakeMethods::Utility::Reffor thecloneandcomparefunctions used above. π
Okay final sign-off, bestie: this page comes from User Contributed Perl Documentation, source/version perl v5.36.0, dated 2022-10-13, and the page is MakeMe...e::Ref(3pm) β slay, bye! π
β¨
π¦ where this page comes from
- ubuntu noble: libclass-makemethods-perl 1.01-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libclass-makemethods-perl 1.01-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libclass-makemethods-perl 1.01-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms