access...hained(3pm)

πŸ“¦
version 1.01 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

ok so first things first πŸ’– this whole page is the manual for accessors::chained β€” a lil Perl pragma you'll find hanging out in the 3pm section of the manual (that's the User Contributed Perl Documentation corner of the universe, bestie). and what does it do? it creates method chaining accessors in the caller's package. that's it. that's the whole job. and it ate πŸ’…


🌸 SYNOPSIS 🌸

ok here's the vibe, verbatim, no notes:

package Foo;
use accessors::chained qw( foo bar baz );

my $obj = bless {}, 'Foo';

# generates chaining accessors:
$obj->foo( 'hello ' )
    ->bar( 'world' )
    ->baz( "!\n" );

print $obj->foo, $obj->bar, $obj->baz;

look at that chain πŸ‘‘ it's giving "one line, three setters, zero drama". literally obsessed.


πŸ¦‹ DESCRIPTION πŸ¦‹

so the accessors::chained pragma is your girl for spinning up simple method-chaining accessors at compile-time. no runtime nonsense, no waiting around β€” it happens while your code is still getting ready ✨

and why does this module even exist? two words: future backwards-compatability 🫢 like, if the default style of accessor ever changes someday (and bestie, it might), method-chaining accessors will still be available through this pragma. so your chains stay unbroken no matter what the default does. iconic insurance policy, fr fr.

heads up though β€” this page is a short one on purpose. the real documentation tea lives elsewhere: See accessors for documentation. go check that one for the full story πŸ’–

πŸŽ€ AUTHOR πŸŽ€

this masterpiece was brought to you by Steve Purkis <spurkis@cpan.org> β€” say thank you, bestie πŸ™ˆ


🌈 SEE ALSO 🌈

go peek at these too, they're all in the same friend group:

  • accessors
  • accessors::classic
  • base

and that's the whole page, babes πŸŽ€ this one's sitting in the 3pm files as perl v5.36.0, dated 2022-10-13 β€” old enough to know better, still out here chaining like a queen πŸ‘‘πŸ’œ mwah, go write some fluent little chains for me βœ¨πŸ¦‹

πŸ“¦ where this page comes from