I played with this a bit and it certainly appears to be a bit of a bug in Perl. The lexical variable is no longer available after the if block but the reference is not destroyed until the next enclosing block is left.
So lexical variables declared inside the conditional of an if block appear to be partly scoped to inside the if block and partly scoped in the scope enclosing the if. Almost sounds reasonable. Almost.
- tye (but my friends call me "Tye")In reply to (tye)Re: Object scope and DESTROY
by tye
in thread Object scope and DESTROY
by Rhandom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |