Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: MooseX::GetOpt disable in roleby tobyink (Canon) |
on Jun 21, 2013 at 10:58 UTC ( [id://1040125]=note: print w/replies, xml ) | Need Help?? |
You haven't posted the code for your disable_getopt_attribute function, but I guess it looks a little like this:
And you're calling it like this from classes:
Try changing the definition to this:
And calling it like this:
This way, the has function that gets called, is My::Script's copy of has; not My::App's copy of it.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|