I'm new to Moose and scratching my head why some code I have is not working properly. Here's the relevant code.
package EventRepository; use Moose; has 'future_existing_events' => ( is => 'rw', isa => 'HashRef', lazy => 1, default => sub { {} }, trigger => \&_get_future_events('existing_events'), ); sub _get_future_events { print Dumper(\@_); ... }
Dumper results in this:
$VAR1 = [ 'existing_events' ];
As you can see, the object is not in the Dumper output and so is not getting passed to the method. I'm not even sure why the trigger method is getting called because I am not setting the future_existing_events attribute anywhere in my code. Other tirggered methods in my code receive the object just fine.
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
In reply to Moose not passing object to triggered method by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |