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

It is an XYZ question. I want to know if it is possible to make things happen this specific way. This isn't a question to solve a specific problem. It is a question about the functionality of PERL. Thanks, for caring enough to post :). -Sean.
  • Comment on RE: Re: AUTOLOAD functions & inheritence

Replies are listed 'Best First'.
RE: RE: Re: AUTOLOAD functions & inheritence
by Anonymous Monk on Mar 30, 2000 at 04:02 UTC

    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.