in reply to Using ArrayRef data members in Moose
The ArrayRef accessor returns an arrayref which you can use like any other arrayref . . .
package Spoo; use Moose; has 'a' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] }, ); no Moose; package main; my $s = Spoo->new; push @{ $s->a }, qw( a b c ); my $idx = 0; for my $x ( @{ $s->a } ) { print $idx++, ": $x\n"; } exit 0; __END__
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|