http://www.perlmonks.org?node_id=923353


in reply to How to add a file to @INC path in perl

Files aren't added to @INC, directories are. For example, if Porter.pm was located in /home/ikegami/perl5/lib, I could do

use lib "/home/ikegami/perl5/lib"; use Porter;

Keep in mind that if the package is My::Porter you, should place the file in /home/ikegami/perl5/lib/My and use

use lib "/home/ikegami/perl5/lib"; use My::Porter;