Additional note: this is a fine example for using Closures.
The two functions are "closing" over the lexical variable $test.
And this $test has a lexical (i.e. static) scope restricted to the block.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
PS: it also demonstrates that closure don't need to be anonymous. There is a widespread misconception in some other languages that "closure" is a synonym for "anonymous function".
In reply to Re^2: local & global function (closures)
by LanX
in thread local & global function
by dideod.yang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |