in reply to Moose, @ISA and method resolution
First off, many thanks for taking the time to answer so many questions about Moose Stevan. It's appreciated by all of us. So a big thanks from me.
Next, I am happy to say that after a nice 6 or more day learning experience (Yeah, that's embarrassing) I've finally determined what's going on. I finally boiled this down to a minimal test case and realized that the code isn't doing what I think the code is doing. MO=Deparse showed that instead of calling Program::Plist::Pl::Pattern->new, I was calling Pattern()->new().
As it turns out, I have a MooseX::Types definition for a Pattern type. At the top of the Pl.pm file, I use Program::Types qw(Pattern) Which means I have now imported a subroutine into my package that has the SAME fully qualified name as my package I'm trying to instance. So when I said Program::Plist::Pl::Pattern->new(), Perl thought I wanted to call the Pattern subroutine &Program::Plist::Pl::Pattern()(which is why I'm off in MooseX::Types land in the debugger) and then call the new method of the result.
I'll post some code tidbits of my mistake here tomorrow in the hope it may help someone else not make the same mistake :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Moose, @ISA and method resolution
by stvn (Monsignor) on Jan 13, 2011 at 02:36 UTC | |
|
Re^2: Moose, @ISA and method resolution
by tilly (Archbishop) on Jan 13, 2011 at 15:38 UTC | |
by stvn (Monsignor) on Jan 14, 2011 at 04:09 UTC |