Re: how to install modules
[email protected] (Gunnar Hjalmarsson)
| Newsgroups | perl.beginners |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: > I tried to install the module plot.pm, There is no CPAN module named plot.pm. There is a module named Chart::Plot, though, with the _file_ Plot.pm. Btw, are GD.pm and libgd available on your system? If not, you'd better install them first, since Chart::Plot is just a front end to GD. > by following the undermentioned method > http://www.base64.co.uk/installing-perl-modules/ but I failed. What > have I missed? Why are you choosing that installation method? Don't you have command line access to your system? > I am using windowsXP. I am using Perl-5-10. I installed perl in > c:\perl\. Apparently you have command line access, then... > 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 Wouldn't it have been better to create the subdirectory C:\Perl\site\lib\Chart and copy Plot.pm into that directory? > 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"); You'd better remove that line. It makes no sense (and causes the compilation error). > use Chart::Plot; Unless you follow my suggestion above, you can't use() the module. You can possibly say require 'C:/Perl/lib/graph/Plot.pm'; but that's not advisable. > print "hello"; -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl