package My::App; use Moose::Role; # ... etc sub disable_getopt_attribute { has("+$_", traits => ['NoGetopt']) for @_; } #### package My::Script; use Moose; with "My::App"; My::App::disable_getopt_attribute(qw/ foo bar /); #### package My::App; use Moose::Role; # ... etc sub disable_getopt_attribute { my $class = shift; my $has = $class->can("has"); $has->("+$_", traits => ['NoGetopt']) for @_; } #### package My::Script; use Moose; with "My::App"; __PACKAGE__->disable_getopt_attribute(qw/ foo bar /);