> -----Original Message----- > From: Nick Perez [mailto:n...@nickandperla.net] > Sent: Saturday, January 22, 2011 2:47 AM > To: Rick Apichairuk > Cc: moose@perl.org > Subject: Re: Inheritance not working for some weird reason. > > Hey Rick, > > So I had at look at your code and cleaned it up some what and made it run > within a single file. In the future, please refrain from large examples. It really > helps people to see your problem better if you can make a very small, very > succinct test. > > From what I can see, this runs without problem. I did have to change the > 'BAD' tests at the bottom to account for the proper values. >
I tried your version and it did work. However, this code was intended to be in separate packages and that is when the error occurs. Did you run my version (in separate class files) and did it work for you? > What versions of MooseX::Declare, Devel::Declare, > MooseX::Method::Signatures, Moose, Class::MOP, and perl are you running > where this is a problem? I have asked 3 other people to run the code and everyone experiences the same problem. We all have varying versions of Moose, MooseX::Declare, Devel::Declare, etc. On my own machine, I am using the following versions: This is perl, v5.10.1 (*) built for i686-linux-gnu-thread-multi Moose 1.21 MooseX::Declare 0.32 Devel::Declare 0.006000 MooseX::Method::Signatures 0.34 Class::MOP 1.11 I had thought it might have been the new lines in > your class declaration that were the issue, but it still runs without issue on my > end even with the newlines. My other thought is perhaps the double > package declarations. You do realize that this: > > package Foo; > > use MooseX::Declare; > > class Foo {...} > > is essentially doing this: > > package Foo; > use MooseX::Declare; > { package Foo; ... } > > right? I know I've had some trouble with Roles in the past where double > declarations of the package has caused issues. If you really want the package > declaration, I suggest scoping it with braces (this is what I've done when > publishing modules to CPAN, so that it runs with the current CPAN toolset). Thanks, I'll definitely keep this in mind in the future. Rick