[cgiapp] can AUTOLOAD sub be named AUTOLOAD?

Perrin Harkins perrin at elem.com
Wed Apr 16 11:48:42 EDT 2008


On Wed, Apr 16, 2008 at 11:30 AM,  <rjmorris12 at gmail.com> wrote:
> Perrin Harkins <perrin at elem.com> wrote on Wed, Apr 16, 2008 at 09:30:48AM -0400:
>   $self->run_modes("AUTOLOAD" => "catchall");
>
>   sub mode1 : Runmode {}
>   sub mode2 : Runmode {}
>   sub catchall {}

I'm not a fan of sub attributes, but that looks pretty good to me.

>  But if the AUTOLOAD problem is a bug that can be fixed
>  easily, then I'd rather do that than use this workaround.

I have no idea if it's a bug or not, but a sub called AUTOLOAD has a
well-known meaning in Perl which you are not entirely following here,
and that seems very confusing to me.  It's kind of like wanting to
call your custom cleanup method DESTROY.

Or maybe I just have a chip on my shoulder because I think obsession
with syntax is one of the more self-destructive traits of the Perl
community.

- Perrin


More information about the cgiapp mailing list