Class::...or::Fast(3)
π NAME π
Class::Accessor::Fast β accessors that go zoom, but likeβ¦ don't expect them to grow wings and fly, bestie
so this is a page from the User Contributed Perl Documentation corner of the universe, and honestly? she's serving efficiency. let's get into it π¦
β¨ SYNOPSIS β¨
package Foo;
use base qw(Class::Accessor::Fast);
# The rest is the same as Class::Accessor but without set() and get().
literally just that. no notes. π
πΈ DESCRIPTION πΈ
okay so. Class::Accessor::Fast is the faster-but-less-expandable sibling of Class::Accessor. same vibes, less flexibility, more speed. it's giving "I'm not complicated, I'm efficient."
here's the tea β: the accessors that Class::Accessor generates need two method calls to do their little task β one for the accessor itself, and then another one for get() or set(). two trips. two whole round-trips, like she's stopping at the drive-thru on the way to work.
Class::Accessor::Fast said "not me doing all that" and eliminates calling set()/get() entirely β she does the access herself. result? a somewhat faster accessor. slay π
the downside (and yes there's always a downside, there's always a catch, it's never just vibes π): you can't easily alter the behavior of your accessors, and neither can your subclasses. that's the trade. that's the whole deal. no customization arc for you.
but bestie, it's fine, because if you need that flexibility later you can always swap out Class::Accessor::Fast for Class::Accessor. it's a whole use base line. you'll survive π«Ά
Read the documentation for Class::Accessor for more info β she's the main character, this one's the spin-off.
π₯ EFFICIENCY π₯
"EFFICIENCY" in Class::Accessor for an efficiency comparison. (yes, that's the whole thing, go look at the other page for the receipts, iykyk π)
π AUTHORS π
Copyright 2017 Marty Pauley <marty+perl@martian.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. That means either (a) the GNU General Public License or (b) the Artistic License. β so like, pick your flavor, both are iconic β¨
π§ ORIGINAL AUTHOR π§
Michael G Schwern <schwern@pobox.com> β the OG, the founder, the one who started it all, we stan π
π SEE ALSO π
Class::Accessorβ go read her, fr fr, she's the whole reference for this one π
okay that's the page!! and for the record, this was rendered out by perl v5.42.0 on 2017-10-23, page Class::...or::Fast(3) β a certified vintage. mwah, drink some water, go write some accessors ππ
π¦ where this page comes from
- opensuse-leap 16.0: perl-Class-Accessor 0.51-160000.2.2 Β· Artistic-1.0 or GPL-1.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms