MakeMe...gleton(3pm)
β¨ NAME β¨
okay so bestie, welcome to the MakeMe...gleton(3pm) page π
β manual name folded in near the top, from the User Contributed Perl Documentation section. We're doing Perl singleton lore today. π¦
Class::MakeMethods::Emulator::Singleton β literally here to emulate Class::Singleton. That's the name, no cap. π
β¨ SYNOPSIS β¨
Like, the whole point is: call it once, get an instance; call it again, get the same instance. The code is doing main character energy:
use Class::MakeMethods::Emulator::Singleton;
# returns a new instance
my $one = Class::MakeMethods::Emulator::Singleton->instance();
# returns same instance
my $two = Class::MakeMethods::Emulator::Singleton->instance();
So $one gets the new instance, and $two gets the same instance β that's the singleton slay. π
β¨ COMPATIBILITY β¨
okay so this module is emulating the functionality of Class::Singleton, using Class::MakeMethods to generate similar methods. Iconic, fr fr. You may use it directly, exactly like the SYNOPSIS above shows. β¨
You may also call:
use Class::MakeMethods::Emulator::Singleton '-take_namespace';
That aliases the Class::Singleton namespace to this package, and subsequent calls to the original package will be transparently handled by this emulator. iykyk. To remove the emulation aliasing, call:
use Class::MakeMethods::Emulator::Singleton '-release_namespace';
Caution: this affects all subsequent uses of Class::Singleton in your program, including those in other modules, and might cause unexpected effects. So, like, be aware, bestie β this is highkey a whole global-namespace vibe shift. π
β¨ DESCRIPTION β¨
A Singleton describes an object class that can have only one instance in any system. Literally one. An example of a Singleton might be a print spooler or a system registry. π¨οΈ
This module implements a Singleton class from which other classes can be derived. By itself, the Class::Singleton module does very little other than manage the instantiation of a single object. ngl, that's its whole thing, and honestly, same. In deriving a class from Class::Singleton, your module will inherit the Singleton instantiation method and can implement whatever specific functionality is required. Periodt. π
β¨ SEE ALSO β¨
The reference section is serving, and yes, every single one is here β vibe check:
- See
Class::MakeMethodsfor general information about this distribution. π - See
Class::MakeMethods::Emulatorfor more about this family of subclasses. π¦ - See
Class::Singletonfor documentation of the original module. π - For a description and discussion of the Singleton class, see "Design Patterns", Gamma et al, Addison-Wesley, 1995, ISBN
0-201-63361-2. π - See
"new"inClass::MakeMethods::Hashand"instance"inClass::MakeMethods::ClassVarfor documentation of the created methods. π₯
okay that's the page, bestie. This manual situation is from perl v5.36.0, dated 2022-10-13, and the page is MakeMe...gleton(3pm) β mwah, 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