Just to give a different solution, I'm going to point out that if you moved your functions into another module that you use or require, then you will find that the initializations automatically happen at the right time.
It is not an implicit BEGIN block if you require the module.
I also think that this solution adds context. It shows why this coding organization won't cause problems most of the time, and gives insight either on when he has to remember to be particularly careful, or else how to avoid it more often. (His choice as to which way to read that.)