I am currently trying to create/generate a CSV file using one of three classes:
use Class::CSV;
use Text::CSV;
use Text::CSV_XS;
Though when I try and run it, to check my code I come up with the same error message:
Can't locate Class/CSV.pm in @INC (@INC contains: C:/Per/site/lib C:/Perl/lib .) at C:\Users\<DIRECTORY> - <DIRECTORY>.file.pl line1
I have tried searching for the files though I haven’t had any luck. Has anyone else come up against this problem? I have looking in the Directory and the CSV.pm file does exists.
Assuming that
Class::CSVis installed on your system, your library search path is incomplete. (Your error message listsC:/Per/site/libas a search lib, which looks like a typo forC:/Perl/site/lib, which you might want to look into.)You need to locate the correct
CSV.pmfile where the library is located. For example, if it’s found in:Then you have one of the following options.
Modify the environment for Perl or the invocation so that this is set (assuming my Windows skill haven’t expired completely, someone feel free to edit and correct if I get the syntax wrong):
You can use the
-Ioption to perl to add the path:You can use the
use libcommand in the program itself to add the search path: