in reply to Re: Moose delegate methods, value not defined
in thread Moose delegate methods, value not defined

Thanks for the reply. From the documentation, I was under the impression that

has 'author' => ( is => 'ro', isa => 'Author', handles => [qw( name )], );

would create an Author object (using the isa command) in the background. I guess I'm incorrect in thinking this.

I had tried letting Moose generate the accessory methods, but wasn't sure if handles was looking for an explicitly defined method in the module or not.

Again, thanks for the reply.

Replies are listed 'Best First'.
Re^3: Moose delegate methods, value not defined
by ikegami (Patriarch) on Mar 05, 2012 at 06:45 UTC

    isa imposes a constraint on what can be placed in author. It doesn't place anything in author. Perhaps you want to add

    default => sub { Author->new() },