in reply to Re^8: Confusion over scope of "my" vars
in thread Confusion over scope of "my" vars
Do you know if this is a well defined feature?
We've already convered this. It's documented to be undefined behaviour.
Can't see why undefining a var with minimized ref-counter should be restricted to a previous my-init !(?)
But you're ok with conditionally declaring variables?
Anyway, there are tWo problems with what yousaid:
In order to reuse the variable, the function needs a reference to it (so it can find it) and the refcount needs to stay above zero (in order for it to be around to be reused). That means the refcounting mechanism won't help us here.
I don't know why they tied it to the execution of my rather than the compilation of my, but it might have to do with saving opcodes. Or simplfying the compiler. Or maybe it would make subroutine reentry too complicated to do otherwise.
|
|---|