Object...Trigger(3pm)
π NAME π
Object::Pad::FieldAttr::Trigger β it's giving "invoke an instance method after a :writer accessor", bestie. Not me explaining this whole vibe below, iykyk.
β¨ SYNOPSIS β¨
use Object::Pad;
use Object::Pad::FieldAttr::Trigger;
class Label {
field $title :param :reader :writer :Trigger(redraw);
method redraw {
...
}
}
my $label = Label->new( text => "Something" );
$label->set_label( "New text here" );
# $label->redraw is automatically invoked
okay like⦠look at her go 𫢠she set the label and the redraw just happened. main character energy fr fr.
πΈ DESCRIPTION πΈ
So this module hands you a third-party field attribute for your Object::Pad-based classes. What it declares is that a named instance method shall be invoked after a generated :writer accessor method gets called. periodt. π
WARNING β the whole ability for Object::Pad to take third-party field attributes is still new and highkey experimental, and it's subject to much API change in future. which means this module should be considered equally experimental. no cap, don't build your whole personality on it yet π
π¦ FIELD ATTRIBUTES π¦
:Trigger
field $name :writer :Trigger(NAME) ...;
Declares that the accessor method generated for the field by the :writer attribute will invoke the method named by the :Trigger attribute β and the way that it does that is after the new value has already been stored into the field itself. π
That method gets invoked with no additional arguments, in void context. So like, don't be out here expecting return values or params, she's not giving you any π
lowkey important: this only applies to the generated accessor method. It does not apply to direct modifications of the field variable by method code within the class itself. like, if your own methods poke at$namedirectly,:Triggeris not gonna show up. she's off duty π
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk>
okay that's the whole page, slay π this one came out of the docs for perl v5.42.3, dated 2026-08-22 β thanks for reading her whole story bestie, mwah ππ§
π¦ where this page comes from
- ubuntu stonking: libobject-pad-fieldattr-trigger-perl 0.07-2build5 Β· 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