how to install modules



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






Relevant Pages

  • Re: security of OpenBSD vs Linux distros
    ... If workgroups need to install any software they can do so in their ... the system staff of around five people have root access. ... Yes, if a cracker does get control of one account, he might be ... >>> walk off with the machine and get a set of important keys. ...
    (comp.os.linux.security)
  • Re: Local install of modules - no root; no telnet
    ... | I'm attempting to install Date::Calc on the server where my scripts are ... I cannot get my test script to run - it tells me ... Perhaps it is a rule of thumb, that a module with .so or .xs files needs root access for ...
    (comp.lang.perl.modules)
  • Re: Restricting Access and Protecting Code
    ... I have written an application in PHP that will be used by telecoms and ISP's. ... It will be installed on a server that will only be running this app. ... As Colin said - you do not have to provide them with root access - nor should you do so! ... Static IP's are generally set up at install time, ...
    (comp.lang.php)
  • Re: !SPAM! [Full-Disclosure] Automated ssh scanning
    ... Most folks 'install' the ... > getting around security barriers, ... > will eventually get root access, ... > you can get shell you can get root, so don't let them get shell"... ...
    (Full-Disclosure)
  • Re: pkgadd without root - there has to be a way
    ... > I am trying to install openssh from sunfreeware.com on a Solaris 8 system on ... > which I do not have root access. ... Whie I haven't looked at this package in particular, ... Keep in mind that Solaris 9 ships with ssh. ...
    (comp.unix.solaris)