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
In reply to Re^4: why avoid & on function call
by LanX
in thread why avoid & on function call
by fireblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |