in reply to Re: Re: Reducing Perl OO boilerplate
in thread Reducing Perl OO boilerplate
I'll cut off the people who will tell you, don't use new, since if you have a function called new in your main:: space, it'll break your program.
Uh, no. Although there is no rule that OO constructors be called "new" it's a pretty standard convention. Some modules (notably DBI) use an alternative constructor name, but it certainly does NOT break anything if you have a subroutine named "new" in package main.
Why would you have a funciton called new? New what? New time of day? New cheese?It's a constructor. It makes a new object. That's why it's called new.
As for the original question, I'm rather fond of Class::MethodMaker. Works for me, though YMMV.
Gary Blackburn
Trained Killer
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: Reducing Perl OO boilerplate
by exussum0 (Vicar) on Feb 18, 2004 at 12:31 UTC | |
Re: Re: Re: Re: Reducing Perl OO boilerplate
by flyingmoose (Priest) on Feb 18, 2004 at 14:55 UTC | |
by Trimbach (Curate) on Feb 18, 2004 at 16:45 UTC | |
by flyingmoose (Priest) on Feb 18, 2004 at 17:02 UTC |
In Section
Seekers of Perl Wisdom