Role-Basic
Role-Basic copied to clipboard
apply_roles_to_package(): should it be possible even after 'with' has run?
See https://gist.github.com/766303 - maybe that's just a 'role-antipattern', but I don't know of a better way to add capabilities to classes based on a configuration setting.
The reason you can't do it after 'with' has run is that you lose the composition safety and that violates the entire spirit of what Role::Basic is trying to do. Perhaps if PERL_ROLE_OVERRIDE_DIE is set it might be OK, but for now, I don't feel entirely comfortable with this.