in reply to Re: BEGIN block question
in thread BEGIN block question

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).

Replies are listed 'Best First'.
Re^3: BEGIN block question
by Anonymous Monk on Jun 05, 2007 at 22:02 UTC
    thank you. that's very clear. i totally forgot that assignment happens at runtime and use happens at compiled time. hence the failure in the BEGIN block.