in reply to Re^4: Perl Moose syntax
in thread Perl Moose syntax
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 ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Perl Moose syntax
by choroba (Cardinal) on Dec 28, 2014 at 15:12 UTC | |
by Anonymous Monk on Dec 28, 2014 at 15:23 UTC |