Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

(tye)Re2: Need help understanding variable scope in modules

by tye (Sage)
on Jul 11, 2001 at 23:48 UTC ( #95834=note: print w/replies, xml ) Need Help??


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?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://95834]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2021-05-12 12:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (127 votes). Check out past polls.

    Notices?