i have a directory with main.pl and Product.pl. in the main.pl i try to import the Product class but the execution fails when i run perl main.pl complaining that cant locate Product.pm in @INC. My directory is not in the @INC list. How can i fix this?
Asked
Active
Viewed 110 times
2 Answers
1
Create a local subdirectory, name it lib
and put your module file there. On newer Perls you must tell Perl to include that local directory to @INC
, either by adding it to PERL5LIB
(environment variable) somehow, or by adding
use lib qw( . );
to the script that wants to load that module. If you are paranoid you can also use an absolute path.

Holli
- 5,072
- 10
- 27
0
You already got some help in complain that module's filename should end in .pm
. Now you need to look for the purpose of variable PERL5LIB=???
.

Polar Bear
- 6,762
- 1
- 5
- 12