The reason it fails inside the BEGIN block is that the use of MyApp::Conf happens while the BEGIN block is being compiled, but the assignment to %ENV happens after the BEGIN block is compiled (i.e., at the BEGIN block's "run time"). If you put it after the BEGIN block, then the compilation (use) of MyApp::Conf happens after the BEGIN block has executed (and the assignment to %ENV has happened).
In reply to Re^2: BEGIN block question
by kyle
in thread BEGIN block question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |