Make it a module. use will automatically run the code at compilation time. You can even leave out the explicit BEGIN block.
Also, pull those use clauses out of your function. use is unconditionally executed at compile time, so putting them in there is just misleading.
PS.: please take the time to learn about PerlMonks linking syntax and use it. Since I read PM using www.perlmonks.org, my cookie is set for that host, so following your link sends me to a page where I'm not logged in. As a bonus, using [id://420722] would have inserted the title of your thread into the text automagically.
Makeshifts last the longest.
In reply to Re: Where to put long BEGIN blocks used by many programs...
by Aristotle
in thread Where to put long BEGIN blocks used by many programs...
by argv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |