in reply to RE: Re: AUTOLOAD functions & inheritence
in thread AUTOLOAD functions & inheritence

In reply to myself (I didn't realize I was anonymous), I think I could give you a less abstract description of the specific problem that inspired this question about perl AUTOLOAD behavior.

I created a class called AutoType that would autoload accessor methods. AutoType is meant to be a base class. The method names/data names were stored in an array. The code if ($fname -eq 'foo') was actually if (grep {$fname -eq $_} @attribs).

I was afraid that if someone used AutoType but then created a AUTOLOAD function of their own, AutoType's AUTOLOAD function would never be used and AutoType wouldn't function.

What I could do instead would be to test for the functions' existence and eval $func_decl the function if it doens't already exist.

-Sean.