Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^10: "my" declaration problemby shmem (Chancellor) |
on Apr 25, 2017 at 21:50 UTC ( [id://1188917]=note: print w/replies, xml ) | Need Help?? |
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:
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.
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
In Section
Seekers of Perl Wisdom
|
|