The reference counter is not neccessarily 0 at the end of the scope
It's never zero at end of scope. At the very least, the pad references the scalar. If the refcount is one at scope exit, the variable is cleared*. If the refcount is greater than one at scope exit, a new SV is created and associated with the variable.
* — Clearing is similar to undefining, but the string buffer isn't cleared.
In reply to Re^5: Confusion over scope of "my" vars
by ikegami
in thread Confusion over scope of "my" vars
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |