Perl: add a path to @INC 

Joined:
04/09/2007
Posts:
710

September 25, 2008 23:43:35    Last update: September 25, 2008 23:43:54
@INC is a list of directories Perl uses to find modules to load. You can add directories to @INC by use lib..., or set the PERLLIB environment variable:

# using default @INC
use Net::Socket::NonBlock;
Can't locate Net/Socket/NonBlock.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at - line 1.
BEGIN failed--compilation aborted at - line 1.

# Add a path
use lib "C:/local/Net-Socket-NonBlock-0.15";
use Net::Socket::NonBlock;
Can't locate Net/Socket/NonBlock.pm in @INC (@INC contains: C:/local/Net-Socket-NonBlock-0.15 
C:/Perl/lib C:/Perl/site/lib .) at - line 2.
BEGIN failed--compilation aborted at - line 2.

# Add a path by setting PERLLIB
C:\>set PERLLIB=C:/local/Net-Socket-NonBlock-0.15
C:\>perl
use Net::Socket::NonBlock;
Can't locate Net/Socket/NonBlock.pm in @INC (@INC contains: C:/local/Net-Socket-NonBlock-0.15 
C:/Perl/lib C:/Perl/site/lib .) at - line 1.
BEGIN failed--compilation aborted at - line 1.
Share |
| Comment  | Tags
 
Easy email testing with http://www.ximailstop.com