in reply to Re^3: why avoid & on function call
in thread why avoid & on function call
exit doesn't end scope.
If you have variables declared in your main part, they could accidentally leak as closures into the subs.
Using sub main { BLOCK } is one way to limit the scope.
I personally rather use a naked { BLOCK }
Like this the distinction to intentionally file-scoped variables outside this main BLOCK becomes obvious.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|