in reply to Cant locate DBI in @INC
You'd need to put the push (@INC, "D:\\Perl\\site\\lib"); in a BEGIN block for it to be of any help for the subsequent use DBI;. Otherwise, the use DBI (which itself implies a BEGIN block) would be run before you have manipulated @INC.
BEGIN { push (@INC, "D:\\Perl\\site\\lib"); } use DBI;
Or simply
use lib "D:\\Perl\\site\\lib"; use DBI;
(The latter would also put the additional lib path in front of the array (like unshift @INC would) — which usually is what you want.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Cant locate DBI in @INC
by Irishboy24 (Sexton) on Sep 17, 2009 at 16:08 UTC | |
by almut (Canon) on Sep 17, 2009 at 16:24 UTC |