argv has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use Bar; BEGIN { print "Testing\n"; } print "this is a test.\n";
I would expect to see "Testing" before it does anything else. But, if Bar.pm has nothing but a single print statement, I see that output before the "Testing" statement is printed. Hence, I'm confused by the following from the perl documentation:
Execution order: BEGIN{}, (possible save of state through compiler back-end), INIT{}, program runs, END{}.
Isn't the "print" statement in Bar.pm part of the "program runs" step in the above sequence?
|
|---|