It was one example of a case where the BEGIN is required. With the BEGIN, it works either way. The BEGIN block makes the code more robust. Moving the exit statement down defeats the whole purpose of that line (which is to prevent the maintainer from having to parse all of the lines between the exit and the sub main looking for hidden run-time code. It forces any run-time code to be put up top or into BEGIN blocks making it easy to find).
Sure, it is easy to produce cases where you don't happen to call GlobalRoutine during the window between its definition and the initialization of $sub. That doesn't mean you won't get bit by it.
- tye (but my friends call me "Tye")In reply to (tye)Re4: Functions
by tye
in thread Functions
by fgcr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |