[Omaha.pm] perl -Moose=foo

Jay Hannah jay at jays.net
Sat Mar 20 14:57:12 PDT 2010


$ perl -Moose=foo -lE 'has attr => (is => "rw", isa => "Str", trigger => sub { say "trigger" }); after attr => sub { say "hi" }; my $f = foo->new(attr => "hello"); say "built"; $f->attr'
trigger
built
hi

Huh. Moose triggers are interesting.

http://search.cpan.org/~flora/Moose-0.99/lib/Moose/Manual/Attributes.pod#Triggers

j




More information about the Omaha-pm mailing list