Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Passing arrayref to Moose attributes

by hdb (Prior)
on Apr 20, 2013 at 14:12 UTC ( #1029643=note: print w/ replies, xml ) Need Help??

in reply to Passing arrayref to Moo attributes

In the headline, you are asking a Moose question but in the code you are using Moo. Does Moo support 'ArrayRef' etc as well? If I change use Moo; to use Moose; and follow moritz' advise, I get no error anymore. I am not too familiar with Moo and Moose, just a guess..

UPDATE: Just found this on


Takes a coderef which is meant to validate the attribute. Unlike Moose, Moo does not include a basic type system, so instead of doing isa => 'Num', one should do

isa => sub { die "$_[0] is not a number!" unless looks_like_number $_[0] },

Comment on Re: Passing arrayref to Moose attributes
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1029643]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2015-11-30 05:12 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (758 votes), past polls