in reply to Debugger and lexicals

The variable has been freed by the time you try to examine it. Each executed file has an implied {} scope round it, and when the file is 'use'd, it is compiled, executed, $a is created and freed, and then the use returns. You can confirm this if you like, by assigning an object to $a with a destructor that prints out an "I'm freed" diag message.

By referring to $a within mt2, you turn mt2 into a closure, which extends the life of $a2 (to that of the life of mt2). Again, using an object you an see that this is the case.

Dave.