Mailmunge::Base(3)

πŸ“¦ version 3.20, in alpine 3.24

πŸ’– 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