Mailmunge::Base(3)
π Mailmunge::Base β the base class for Mailmunge objects π
okay so this is Mailmunge::Base(3), from the User Contributed Perl Documentation crew β yes bestie, we're in the perl section of the man pages, get comfy π«Ά
β¨ ABSTRACT β¨
Mailmunge::Base is literally just handing you one (1) convenience function that builds accessors for you β those lil get-and-set methods for instance variables. that's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
here's the whole thing in action, no cap:
package MyThing;
use base qw(Mailmunge::Base);
my @accessors = qw(height weight age);
__PACKAGE__->make_accessors(@accessors);
# Defines getters/setters MyThing::height, MyThing::weight and
# MyThing::age
my $thing = MyThing->new();
$thing->age(20);
my $x = $thing->height;
so you inherit from Mailmunge::Base, you hand make_accessors a list of names, and boom β MyThing::height, MyThing::weight and MyThing::age all exist now. iconic behavior honestly π
π CLASS METHODS π
π¦ make_accessors(@accessors)
you pass it an array of accessor names and it creates a getter and a setter for each one. every method gets named after the matching element of @accessors β like, one-to-one, no funny business β¨
and here's the rule that makes it all work, bestie:
- call it with no parameters β it's a getter π
- call it with one parameter β it's a settor βοΈ
that's the entire personality. getter when empty, settor when you feed it something. periodt π
π AUTHOR π
Dianne Skoll <dianne@skollsoft.com> β yeah, she built this, show some respect π
π LICENSE π
this code is licensed under the terms of the GNU General Public License, version 2. read the license, bestie, it's the law (literally) β
lowkey reminder: @accessors names become your method names, so pick them like you pick your usernames β carefully π«Ά
π and that's a wrap on Mailmunge::Base(3)!! this lil page comes to you courtesy of perl v5.42.2, dated 2025-10-05 β go forth and make accessors, mwah ππ
π¦ where this page comes from
- alpine 3.24: mailmunge-doc 3.20-r0 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms