MakeMe...:Basic(3pm)
π Class::MakeMethods::Basic(3pm) β Make really simple methods π
okay so youβve landed on the Class::MakeMethods::Basic page from User Contributed Perl Documentation (header situation: MakeMe...:Basic(3pm) π), and itβs literally here to make really simple methods. no cap, thatβs the whole assignment. π
β¨ NAME β¨
Class::MakeMethods::Basic β Make really simple methods.
Itβs giving βbasicβ in the best way: stripped-down, cute, and here to generate your methods without the extra drama. π
π SYNOPSIS π
package MyObject;
use Class::MakeMethods::Basic::Hash (
'new' => [ 'new' ],
'scalar' => [ 'foo', 'bar' ]
);
package main;
my $obj = MyObject->new( foo => "Foozle", bar => "Bozzle" );
print $obj->foo();
$obj->bar("Barbados");
Like, look at that. new, foo, bar, Foozle, Bozzle, Barbados β the whole friend group is here. π«Ά
π DESCRIPTION π
This page describes the various subclasses of Class::MakeMethods that live under the Basic::* namespace, plus the method types each one provides. π
The Basic subclasses give you stripped-down method-generation implementations. lowkey minimalist. highkey useful.
Subroutines are generated as closures bound to each method name. periodt.
π«Ά Calling Conventions π«Ά
When you use a subclass of this package, the method declarations you hand over as arguments cause subroutines to be generated and installed in your module. β¨
You can also leave out the arguments to use and instead make methods at runtime by passing the declarations to a subsequent call to make(). very βweβll do it liveβ of you. π€
You may include any number of declarations in each call to use or make(). If methods with the same name already exist, earlier calls to use or make() win over later ones β but inside each call, later declarations superceed earlier ones. (yes, superceed is the spelling in the original, bestie π keep it moving.)
You can install methods in a different package by passing -TargetClass => package as your first arguments to use or make. π¦
See βUSAGEβ in Class::MakeMethods for more details.
π Declaration Syntax π
The following types of declarations are supported:
generator_type => 'method_name'generator_type => 'name_1 name_2...'generator_type => [ 'name_1', 'name_2', ...]
For a list of the supported values of generator_type, see βBASIC CLASSESβ in Class::MakeMethods::Docs::Catalog, or the documentation for each subclass. π
For each method name you provide, a subroutine of the indicated type will be generated and installed under that name in your module. π«
Method names should start with a letter, followed by zero or more letters, numbers, or underscores. thatβs the rule, bestie β letters first, then letters/numbers/underscores can pull up. π€
π₯ SEE ALSO π₯
See Class::MakeMethods for general information about this distribution. πΈ
<η΄«θ²>For distribution, installation, support, copyright and license information, see</η΄«θ²> Class::MakeMethods::Docs::ReadMe. π
mwah π β this little manpage was served by perl v5.36.0, dated 2022-10-13, and its footer tag is MakeMe...:Basic(3pm). slay, go make some really simple methods. πβ¨
π¦ 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