Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Alternatives to User::Agent?

by sgifford (Prior)
on Jul 20, 2003 at 15:21 UTC ( #276054=note: print w/ replies, xml ) Need Help??


in reply to Re: Alternatives to User::Agent?
in thread Alternatives to User::Agent?

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).


Comment on Re: Re: Alternatives to User::Agent?
Re: Re: Re: Alternatives to User::Agent?
by tilly (Archbishop) on Jul 20, 2003 at 17:09 UTC
    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 agree, even though my script doesn't allow arbitrary code to be run, that leaving it lying around is a bad idea. If you're feeling particularly paranoid, you can create an admin directory of cgi-bin with a .htaccess file that protects them with a password.
Re: Re: Re: Alternatives to User::Agent?
by meatpopsicl3 (Initiate) on Jul 21, 2003 at 23:58 UTC
    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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2015-07-05 21:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls