in reply to Alternatives to User::Agent?

From perldoc ExtUtils::MakeMaker:

The quickest way to install a module in a non-standard place might be

   perl Makefile.PL PREFIX=~

This will install all files in the module under your home directory, with man pages and libraries going into an appropriate place (usually ~/man and ~/lib).

So if you have shell access, you can use whatever modules you like.

--Bob Niederman, http://bob-n.com

Replies are listed 'Best First'.
Re: Re: Alternatives to User::Agent?
by sgifford (Prior) on Jul 20, 2003 at 15:21 UTC
    Even without shell access, you can often install modules. I frequently write short shell scripts, upload them into my Web hoster's cgi-bin directory, then use them to compile and install my Perl modules:
    #!/bin/bash -x
    
    printf "Content-type: text/plain\n\n"
    exec 2>&1
    
    H=/home/virtual/site199/fst/home/suspectclass
    export PERL5LIB=$H/lib/perl5
    MOD=Email-Valid-0.14
    
    cd $H/src
    tar xvzf "$MOD.tar.gz"
    cd "$MOD"
    make clean
    perl Makefile.PL LIB=$H/lib/perl5 && 
      make && 
      make test && 
      make install
    
    I just set H to my home directory (which I often get by running a shell script that just does pwd, since I may be chroot'd when I FTP in), then browse to the CGI script. On Mozilla at least, the lines come across in real time.

    Setting PREFIX may work even better than just setting LIB, but I haven't tried it (I will next time).

      Just be careful after you do so to remove them again. (Allowing people to run arbitrary shell scripts is a security hole.)

      UPDATE: bobn is right. The above script does not allow someone to run arbitrary code. This reply was just a knee-jerk response to seeing someone doing administration through running shell scripts in cgi-bin.

        Where does the script run an abritrary shell script?

        --Bob Niederman, http://bob-n.com
      I figured out that the module I need to LWP::UserAgent is libwww-perl-5.69.tar.gz

      Now, do I need to put anything into /lib/perl5 ?

        You need to compile that package and install it somewhere. If you're not the admin of the system, you'll have to install into someplace under $HOME, like $HOME/lib/perl5.

        You should be able to modify my earlier script to compile and install your module without having shell access.

Re: Re: Alternatives to User::Agent?
by meatpopsicl3 (Initiate) on Jul 21, 2003 at 23:52 UTC
    sorry, no shell access :-(