I didn't test it but INIT kicks in when
everything is finished compiling, perlsub -
"INIT" blocks are run just before the Perl runtime begins execution, in
"first in, first out" (FIFO) order. For example, the code generators
documented in perlcc make use of "INIT" blocks to initialize and
resolve pointers to XSUBs.
So various modules can register INIT blocks. The INIT blocks are all postponed until just before perl starts executing, at which point it runs all the INIT blocks in the order they were registered and then finally it goes to line 1 of your program.
$@ is the only place where an error from an eval will show up, if you don't do something about it, the error will disappear forever, that's what makes it possible to ignore an error with eval. Of course if there is something wrong with the module and we ignore the error, the program will probably fail anyway however it will fail with a confusing error message. For example if mod.pm is
package mod;
sub foo{
print "hello world\n; # eek! missing a double quote
}
1;
and we do
eval "use mod";
mod::foo();
we get
Undefined subroutine &mod::foo called at - line 2.
because foo didn't compile however what we really want is
eval "use mod";
die $@ if $@;
mod::foo();
Can't find string terminator '"' anywhere before EOF at mod.pm line 3.
Compilation failed in require at (eval 1) line 2.
BEGIN failed--compilation aborted at (eval 1) line 2.