Um, no, it doesn't. It's called a closure. It's a wonderful aspect of perl. It latches on to the $someobj that is visible at the time that the code ref is created, even if it's a my $someobj in the surrounding function. Yes, $someobj has to pre-exist, but it doesn't need to be global.
In reply to Re^3: Fake a sub ref?
by Tanktalus
in thread Fake a sub ref?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |