1 2 3 4 5 6
use Object::Enum qw(Enum); my $color = Enum([ qw(red yellow green) ]); # ... later if ($color->is_red) { # it can't be yellow or green