use Object::Enum qw(Enum); my $color = Enum([ qw(red yellow green) ]); # ... later if ($color->is_red) { # it can't be yellow or green Author: Hans Dieter Pearcey WWW: http://search.cpan.org/dist/Object-Enum/