Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Perl module

by Thilosophy (Curate)
on Jan 15, 2005 at 04:14 UTC ( #422453=note: print w/ replies, xml ) Need Help??


in reply to Copy perl module to webhost

Yes, if the module is pure Perl (as opposed to modules that contain C code) you can just copy it to a folder on your web server.

As for finding the module, if you put it in your cgi-bin directory, the CGI script should find it automatically. (If the module is Foo::Bar, make put it to cgi-bin/Foo/Bar.pm ). If you want to put it somewhere else, use lib '/some/path'.

Now the bad news: Date::Calc contains C code and needs to be compiled on the host machine. That needs shell access. You can still install it in your cgi-bin (or anywhere else), so you do not need root access, but you need shell access to compile it.

Recommended reading: A Guide to Installing Modules here on PerlMonks

Update: Actually, as sgifford pointed out below, (please vote him up !) you do not really need shell access: You can wrap the install script in a CGI script and run it through the web server.


Comment on Re: Perl module
Download Code
Re^2: Perl module
by sgifford (Prior) on Jan 15, 2005 at 05:17 UTC
    I install things without shell access all the time. It goes something like this:
    $ wget module-src.tar.gz $ cat >install-module #!/bin/sh -x printf "Content-type: text/plain\n\n" tar xvzf module-src.tar.gz cd module-src perl Makefile.PL PREFIX=/your/home make make test make install ^D $ ftp your.hosting.site ftp> cd cgi-bin ftp> bin ftp> put module-src.tar.gz ftp> put install-module ftp> site chmod +x install-module ftp> quit

    Then visit http://your.site/cgi-bin/install-module. Of course this will all vary somewhat, but the basic formula works.

    Update: As CountZero says, your provider must have the appropriate compiler available. And don't forget to remove the install-module script when you're done, for security reasons.

Re^2: Perl module
by CountZero (Bishop) on Jan 15, 2005 at 10:32 UTC
    Provided of course your web-host has a C-compiler installed and available to be run by whatever privileges the cgi-process runs under.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://422453]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-12-25 14:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls