I'd go with the init() function. One can call the superclass' $self->SUPER::init(@_) from that.
Just my 2 cents, -gjb-
For an example, see below:
| [reply] [d/l] [select] |
Interesting, thanks. Unfortunately, I've got some modules from CPAN which do important work in new() rather than init, like Exception::Class from CPAN. Calling SUPER::init misses all the secret sauce happening in the super class constructor.
for the moment I'm bypassing Class::MethodMaker in those classes which need to call SUPER::new but it seem like a bit of a hack. It would be great to have an option to Class::MethodMaker to call SUPER::new in the generated constructor....
| [reply] |
| [reply] |
(Commenting on a very old thread)
I agree, it would be nice if MehodMaker were extended so that it could call SUPER::new().
I found this thread because I'm trying to figure out how to get MethodMaker-derived classes to call *any* sort of SUPER::__() function. Right now I'm bugging the perl-beginners mailing list about why it doesn't work.
-Dan
| [reply] |