in reply to Classes Are Killing Me
I use an anonymous hash there so you're not recreating the same object each time -- if you use $Person::list, you'll always get back the same object. That may be what you want, if you know what a Singleton is, but get this part down first and add complexity later. :)sub new { my $class = shift; bless({}, $class); }
Oh, and in your accessors, shift off $self and use that. Have you read perltootc?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Classes Are Killing Me
by straywalrus (Friar) on May 19, 2002 at 04:57 UTC | |
by chromatic (Archbishop) on May 19, 2002 at 05:17 UTC |