Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Perl module

by Thilosophy (Curate)
on Jan 15, 2005 at 04:14 UTC ( [id://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.

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://422453]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-03-28 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found