Not a massive fan of the before new bit. This is something that I think ought to be handled in Moo itself; either by making $instance->new(%params) do something useful, or by making it die with a sensible error message.
Not sure what lines 8 and 9 are supposed to be doing. Did you put them in for debugging and forget to remove them?
# lines 8 and 9... use Data::Dumper; $Data::Dumper::Indent = 1;
Other than that, looks good.
I like the use of coderefs for private methods. I've been using this technique increasingly myself, having found the "private methods begin with an underscore" convention inadequate (too easy to accidentally override private methods in a superclass).
When I write about methods in my book I plan on promoting a four-level method privacy convention similar to .NET (private/protected/friend/public). Private methods would be coderefs in lexical variables.
In reply to Re: RFC: Converted Fiscal5253 from Classic OO Perl to Moo
by tobyink
in thread RFC: Converted Fiscal5253 from Classic OO Perl to Moo
by boftx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |