Commit | Line | Data |
---|---|---|
8cfc65ef | 1 | package Three; |
2 | ||
3 | use Moose; | |
4 | ||
5 | my $called_foo = 0; | |
6 | ||
7 | sub get_called_foo { $called_foo } | |
8 | ||
9 | has foo => (is => 'rw', required => 1 ); | |
10 | ||
11 | sub BUILD { | |
12 | my $self = shift; | |
13 | $self->foo(42); | |
14 | } | |
15 | ||
16 | #before foo => sub { | |
17 | # my ($self, $val) = @_; | |
18 | # $called_foo++ if $val; | |
19 | #}; | |
20 | ||
21 | __PACKAGE__->meta->make_immutable; | |
22 | ||
23 | 1; |