Enumerations
How enumerations work is pretty self-explanatory:
enum Colours => qw( Green Red Blue Yellow Orange Black Silver Grey White Purple Other ); has colour => ( isa => 'Colour' is => 'rw' );
Moose gets way cooler.Lets check out some of Moose's other features. |
How enumerations work is pretty self-explanatory:
enum Colours => qw( Green Red Blue Yellow Orange Black Silver Grey White Purple Other ); has colour => ( isa => 'Colour' is => 'rw' );