in reply to Re^7: repeated use of module and EXPORT
in thread repeated use of module and EXPORT

The begin doesn't work without the our before it... is our also implicitly a BEGIN?

Every line of code is compiled. Some of them are executed at least once.

BEGIN causes code to be executed as soon as it's compiled. That's completely unrelated to the effect of compiling the code in the first place.

The compile-time effect of most code is to add operations to the execution tree. our's compile-time effect to create a variable. It has no run-time effect (as far as I know).

Here's another example.

>perl -le"sub foo { 3 } print foo + 4" 3 >perl -le"sub foo() { 3 } print foo + 4" 7

Compiling the function modifies the symbol table, which in turns affects how a later statement (print foo + 4;) is compiled. This is independent of when the later statement is executed, so putting it in a BEGIN won't change anything.