http://www.perlmonks.org?node_id=95834


in reply to Re: Need help understanding variable scope in modules
in thread Need help understanding variable scope in modules

Good point. With the function defined within the module (as is implied), I thought that inheritance would not matter. But if AUTOLOAD gets inherited, then the parent class's AUTOLOAD might want to call the child class's _accessible. I just checked and AUTOLOAD does get inherited in 5.6 (I have vague memories of something about this being considered as a bug and can see inherited AUTOLOAD causing some surprises but can also see uses for it so I wasn't sure what the current state was).

Anyway, I thought that the question implied that inheritance wasn't desired or I would have mentioned it. But thinking on it more, I wouldn't be surprised if that AUTOLOAD was designed to be inherited as part of a technique for inheriting member data.

Thanks for the catch.

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re2: Need help understanding variable scope in modules

Replies are listed 'Best First'.
Re: (tye)Re2: Need help understanding variable scope in modules
by BrentDax (Hermit) on Jul 12, 2001 at 00:16 UTC
    There was a bug where the docs said that AUTOLOAD wouldn't inherit on non-object calls but it did. IIRC, they made a warning when AUTOLOAD inherited on a non-object in 5.004 and outright outlawed it in 5.005.

    =cut
    --Brent Dax

    @HPAJ=split("", "rekcaH lreP rentonA tsuJ"); print reverse @HPAJ; #sucky but who cares?