in reply to Cant locate DBI in @INC
This post adds to almut's post in case you want more details on compilation and execution order. If you don't, then skip this post.
is the same asuse Module;
BEGIN { require Module; Module->import(); }
(In fact, in existing versions of Perl, the parser can't tell the difference and that's the source of a bug unrelated to this post.)
BEGIN blocks are execute as soon as they are compiled, so
is executed as follows:push (@INC, "D:\\Perl\\site\\lib"); use DBI;
As you can see, the modification of @INC happens much much too late.
|
|---|