Sub::A...:Small(3pm)

πŸ“¦
version 1.001002 Β· 3 versions
, in ubuntu resolute, ubuntu stonking

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


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