While the following does the job, and I'm ok with it, I'm curious as to why the BEGIN block doesn't work. Can anyone provide some enlightenment?
Because the parses sees the call of foo before the declaration (yes, the "called too early" warning happens at compile time). A BEGIN block further down the file is still parsed later than the lines before it.
In reply to Re: BEGIN block and prototyped subroutines
by moritz
in thread BEGIN block and prototyped subroutines
by hangon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |