sub once { my $wrapper; $wrapper = sub { print 1; }; weaken $wrapper; return $wrapper; } my $on = once; $on->();
I don't see any difference with or without weaken $wrapper;,what's it there for?
In reply to What's the weaken here for? by PerlOnTheWay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |