Secondly in a closure you have access to a variable in an outer scope, which is "enclosed" in the sub (hence the name), in your first example $total_size.
In reply to Re: Closures clarification
by moritz
in thread Closures clarification
by props
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |