There's not a single compile-time. When one says "at compile-time", one means "when the containing unit (statement, block, file) is being compiled". Same goes for run time.
use A;
is basically
BEGIN {
require A;
A->import();
}
use statements and BEGIN blocks are executed as soon are they are compiled, so the following happens
- use A; is compiled.
- use A; is executed. (BEGIN blocks are executed as soon as they are compiled.)
- require A; is executed.
- If A hasn't previously been loaded,
- A is loaded and compiled.
- ...
- require Exporter; is compiled.
- @ISA = qw(Exporter); is compiled.
- @EXPORT = qw( abc ); is compiled.
- ...
- A is executed.
- ...
- require Exporter; is executed.
- If Exporter hasn't previously been loaded,
- Exporter is loaded and compiled.
- ...
- sub import { ... } is compiled.
- ...
- Exporter is executed.
- ...
- @ISA = qw(Exporter); is executed.
- @EXPORT = qw( abc ); is executed.
- ...
- A->import(); is executed.
As you can see, Exporter is loaded and its import method is compiled before your module's import is called without having to make any modifications.
(I usually use "ModA" instead of "A" because "B" is the name of an existing module.)