in reply to Re: Using ArrayRef data members in Moose
in thread Using ArrayRef data members in Moose

That's saying that the class' instances have a method add_things which when called will push its arguments on to the end of the arrayref instance variable in question. It's sugar for something like this:

package Foo; use Moose; has 'some_method' => ( is => 'ro', isa => 'ArrayRef', default => sub { +[] }, ); sub add_things { my $self = shift; push @{ $self->some_member }, @_; }

The provides makes it write methods which perform that operation (be it push, or pop, or keys, or . . .) on the instance's member in question.

Update: Minor wording tweaks and removed metaclass declaration from sample code since it's superfluous.

The cake is a lie.
The cake is a lie.
The cake is a lie.