access...hained(3pm)
β¨ 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:
accessorsaccessors::classicbase
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
- ubuntu noble: libaccessors-perl 1.01-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libaccessors-perl 1.01-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libaccessors-perl 1.01-4 Β· 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