use Types::Standard qw(Any Enum); has error_mode => ( is => 'rw', isa => (Enum[qw/carp error both/])->plus_coercions(Any, q{'both'}), # default to 'both' coerce => 1, );