Sub::A...:Small(3pm)
π Sub::Accessor::Small β the manual, but make it cute π
okay bestie, welcome to the Sub::A...:Small(3pm) page β yeah that's the manual name up there, they truncated it all dramatic like, but you and me both know it's really Sub::Accessor::Small and it lives in the User Contributed Perl Documentation section. buckle up, it's short but it slays. π¦
β¨ NAME β¨
Sub::Accessor::Small β a lil tiny toolkit for generating getter/setter methods. it's giving minimalist. it's giving useful. no cap. π
πΈ SYNOPSIS πΈ
here's the whole vibe, bestie, copy-paste ready:
package MyClass;
use Sub::Accessor::Small;
use Types::Standard qw( Int );
sub new {
my $class = shift;
my $self = bless \$class, $class;
my %args = @_ == 1 ? %{ $_[0] } : @_;
# Simple way to initialize each attribute
for my $key ( sort keys %args ) {
$self->$key( $args{$key} );
}
return $self;
}
'Sub::Accessor::Small'->new(
package => __PACKAGE__,
name => "foo",
is => "rw",
isa => Int,
)->install_accessors();
package main;
my $obj = MyClass->new( foo => 42 );
likeβ¦ the way it just works?? obsessed. π₯
π DESCRIPTION π
so here's the tea β β this is a small toolkit for generating Moose-like attribute accessors. that's it. that's the whole job description.
and listen β it does not generate a constructor. not its problem, not its business, not in its job description. you write your own, queen. π
it stores attribute values inside-out, which is a whole vibe. BUT β and this is the cute part β it's designed so that Sub::Accessor::Small can be subclassed, which makes it super easy to store attributes in other ways. flexible fr fr. π§
π¦ BUGS π¦
found a bug? π don't suffer in silence, bestie β please report any bugs to:
<http://rt.cpan.org/Dist/Display.html?Queue=Lexical-Accessor>
(yeah the queue name says Lexical-Accessor, we don't make the rules, we just report the bugs π)
π SEE ALSO π
- Lexical::Accessor β its cousin, its sister, its fellow icon. go look. π
π AUTHOR π
Toby Inkster <tobyink@cpan.org> β the main character who made this. β¨
π COPYRIGHT AND LICENCE π
this software is copyright (c) 2013-2014, 2017, 2020, 2025 by Toby Inkster.
it's free software, babe β you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt. π
π₯ DISCLAIMER OF WARRANTIES π₯
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
translation: it's as-is, no promises, no refunds, no "but you saidβ". iconic but legally unbothered. π
and that's a wrap on the manual, bestie!! π«Ά this page came to you from perl v5.40.1, dated 2026-02-06, filed under Sub::A...:Small(3pm) β mwah, go write some accessors πβ¨π
π¦ where this page comes from
- ubuntu resolute: liblexical-accessor-perl 1.001002-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liblexical-accessor-perl 1.001002-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms