These are all exactly equivalent:
has 'friends' => ( is => 'rw', isa => 'Array', default => () ); has friends => ((is => 'rw'), (isa => 'Array'), (default => ())); has friends => is => 'rw', isa => 'Array', default => (); has friends => is => rw => isa => Array => default => (); has "friends", "is", "rw", "isa", "Array", "default", (); has qw/friends is rw isa Array default/, ();
Moose has just chosen to write things the way they do, but you're free to choose any of the above, whichever is clearest to you - that's a lot of freedom! It's just a matter of taste, and arguing about it is just like arguing about whether your sandwich tastes better depending on if it's sliced diagonally, horizontally or vertically ;-)
In reply to Re^5: Perl Moose syntax
by Anonymous Monk
in thread Perl Moose syntax
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |