Hi, I tried to install the module plot.pm, by following the undermentioned method http://www.base64.co.uk/installing-perl-modules/ but I failed. What have I missed? I am using windowsXP. I am using Perl-5-10. I installed perl in c:\perl\.
To install the module plot.pm, using the methods below, I create a new subdirectoy c:\perl\lib\graph, and then copy plot.pm into c:\perl\lib\graph, so now I have the file plot.pm in c:\perl\lib\graph\plot.pm I then run a test but the results says :- Can't locate Chart.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at Untitled1 line 4. BEGIN failed--compilation aborted at Untitled1 line 4. ############ testing script ################ use strict; use warnings; use Chart("c:\\perl\\lib\\graph\\plot.pm"); use Chart::Plot; print "hello"; ################################### ################################## Using CPAN modules without Root access If you are using a web hosting account which doesn't give you access to the operating system, so that you can install perl modules as described above, then you can still use modules by setting up your own lib folder. Typically the best place to locate the lib folder is under you cgi-bin directory. The tree structure below shows where you would need to upload the Template.pm file to use Html::Template. / | --/cgi-bin | --/lib | --/Html Template.pm The module name will determine where the .pm files need to be located under your lib directory. The text prior to the :: will become the directory name. For example the Calc.pm module that comes with Date::Calc will need to go into a sub-directory of lib called Date. / | --/cgi-bin | --/lib | --/Html | Template.pm | --/Date Calc.pm To use the module within a Perl script, you need to call the Lib module, passing it the full system path to your lib folder. You can then use the modules in the normal way, see the example code below. Please note some CPAN modules rely on other modules being present, and if that's the case then you will need to upload them as well. #/path/to/perl -w use strict; use lib(/full/path/to/cgi-bin/lib); use Html::Template; . rest of code