Type constraints to the rescue
has 'config' => ( is => 'ro', isa => 'HashRef', ); Class->new(config => 'foo');
- DIES
Attribute (config) does not pass the type constraint because: Validation failed for 'HashRef' failed with value 'foo'
- Find out about your mistake as soon as possible