in reply to Re^9: "my" declaration problem
in thread "my" declaration problem
How is it possible that $atexit holds 2 objects which are both destroyed at scopes end?
Because there are 2 $atexit variables - a masked one, and a masking one created later.
This is all to fullfill what hath been written:
"my" variable $var masks earlier declaration in same scope
Since it masks that variable - and does not replace it since this would mean destroying the current my variable of that name, the scope of the masked variable ends when the masking ends - because the scope of the masking variable ends - which is: at scope end.
IMHO this is not an implementation specific detail, but part of the the design of my and perl scopes, thus part of the language.
|
|---|