That's a lot of extra lexicals that aren't being used in the closure. Does it carry them around?The long and the short of it is 'no'. A closure will only store the lexical variables in its lexical pad that are referenced within the subroutine. As Abigail-II's code aptly demonstrates $name's DESTROY method is called upon the exit of make_accessor() (which is its immediate lexical scope) and therefore wasn't held in the closure created.
_________
broquaint
update: added clarification
In reply to Re: Closures and lexical scope
by broquaint
in thread Closures and lexical scope
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |