Michael,

Well, if you are extending a non-Moose class, I assume you are calling the non-Moose constructor. In which case Moose has nothing to do with this.

If you are extending a non-Moose class and using the Moose constructor then,.. well I would need to see some code as there are many different ways you could be doing that and so many different ways to solve this problem.

- Stevan


On Feb 22, 2009, at 7:00 AM, Michael Potter wrote:

Hi

I am extending a non-Moose class, and I want to add an attribute to my
derived class. Problem is, the base class complains (loudly) if it
gets attributes it was not expecting - and it seems the new attribute
in the derived class get passed down to the base, hence the problem.
Is there an easy way to remove an attribute from the constructor hash
once it has been used to initialize an attribute? Something like this
would be nice:

has type => (
   is        => 'ro',
   gobble => 1 # remove element from constructor hash when used to
initialize this attribute
);

Cheers

Reply via email to