[Israel.pm] bless and AUTOLOAD

Gabor Szabo szabgab at gmail.com
Tue Sep 25 23:14:44 PDT 2007


On 9/26/07, Yona Shlomo <yona at cs.technion.ac.il> wrote:
> On Tue, 25 Sep 2007, Gabor Szabo wrote:
>
> > On 9/25/07, Yona Shlomo <yona at cs.technion.ac.il> wrote:
> >> On Tue, 25 Sep 2007, Gabor Szabo wrote:
> >> Your comment
> >>> # to avoid triggering AUTOLOAD
> >>
> >> Is well in place, but alas, I'm too lazy to implement
> >> several dozens of functions/methods that are the same except
> >> for their name... and then change (all of them with no
> >> mistakes) then when needed...
> >
> > I did not understand this one.
> > What do you mean?
>
> I agree with your statement that AUTOLOAD is best avoided.
> However, its functionality helps me a lot with not writing
> several dozens of similar functions that differ mostly by
> name in one place and not worry about them and their
> maintenance.

I actually did not mean to avoid AUTOLOAD, I mean to trigger AUTOLOAD instead
of the DESTROY method. If in AUTOLOAD you actually check if one has
called one of the valid functions and croak if not,
then I don't think it is such an issue.


BTW isn't Class::Accessor http://search.cpan.org/dist/Class-Accessor/
 what you are looking for ?

Gabor



More information about the Perl mailing list