in reply to What is the scope of BEGIN? Or... when does it "begin?"
use Bar is equivalent to
If Bar.pm contains top-level statements, like the print statement you cite, they will get executed during the require. Since this all happens in a BEGIN block that appears before the BEGIN that contains the print "Testing\n" statement, you will see its effects earlier. See use.BEGIN { require Bar; Bar->import(); }
the lowliest monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What is the scope of BEGIN? Or... when does it "begin?"
by argv (Pilgrim) on May 06, 2005 at 05:21 UTC | |
by merlyn (Sage) on May 06, 2005 at 05:36 UTC | |
by ysth (Canon) on May 06, 2005 at 16:15 UTC | |
by argv (Pilgrim) on May 06, 2005 at 17:17 UTC | |
by tye (Sage) on May 06, 2005 at 17:44 UTC | |
by argv (Pilgrim) on May 06, 2005 at 17:54 UTC | |
| |
by tlm (Prior) on May 06, 2005 at 05:34 UTC | |
|
Re^2: What is the scope of BEGIN? Or... when does it "begin?"
by bart (Canon) on May 07, 2005 at 11:48 UTC |