Dear Monks,

Happy New Year!

I have been using the GD.pm module (although this question applies to any such module) on my local server (WinXP, ActivePerl...PPM installation) for some time now and need to install it on my remote server. The remote server is linux and I do not have root access or telnet/command-line access. This obviously makes installing any perl module that requires compilation quite tricky.

I have been trying to use CPAN.pm through its programming interface as a possible solution. This is recommended from literature I have read but I can't seem to make it work.

Firstly, the literature:
http://search.cpan.org/~andk/CPAN-1.80/lib/CPAN.pm#FAQ - see point 5
http://sial.org/howto/perl/life-with-cpan/non-root/ - some more on this subject

I've tried to use this information but obviously it is designed for someone with command-line access.

My code:

1 #! /usr/bin/perl -w 2 3 use CPAN; 4 CPAN::Config='EDITED FOR SECURITY PURPOSES'; 5 6 print "Content-type: text/html\n\n"; 7 my $mod = 'GD'; 8 print "Working...<br>"; 9 10 my $obj = CPAN::Shell->expand('Module',$mod); 11 $obj->install; 12 print "<br>Finished";
In particular, line 4 seems dodgy. This is my reckoning of % echo '$CPAN::Config={ };' > $HOME/.cpan/CPAN/MyConfig.pm from the CPAN notes above. Note the absolute path.

Finally, the modified MyConfig.pm as explained in http://sial.org article. Again, my absolute paths feature, although I'm not sure if I've applied this correctly.

$CPAN::Config = { 'build_cache' => q[5], 'build_dir' => q[EDITED FOR SECURITY PURPOSES], 'cache_metadata' => q[1], 'cpan_home' => q[EDITED FOR SECURITY PURPOSES], 'dontload_hash' => { }, 'ftp' => q[/usr/bin/ftp], 'ftp_proxy' => q[], 'getcwd' => q[cwd], 'gzip' => q[/usr/bin/gzip], 'histfile' => q[EDITED FOR SECURITY PURPOSES], 'histsize' => q[100], 'http_proxy' => q[], 'inactivity_timeout' => q[0], 'index_expire' => q[1], 'inhibit_startup_message' => q[0], 'keep_source_where' => q[EDITED FOR SECURITY PURPOSES], 'lynx' => q[ ], 'make' => q[/usr/bin/make], 'make_arg' => q[], 'make_install_arg' => q[], 'makepl_arg' => q[PREFIX=~/ SITELIBEXP=~/lib/perl5 LIB=~/lib/perl5 I +NSTALLMAN1DIR=~/share/man/man1 INSTALLMAN3DIR=~/share/man/man3 INSTAL +LSITEMAN1DIR=~/share/man/man1 INSTALLSITEMAN3DIR=~/share/man/man3], 'ncftp' => q[ ], 'ncftpget' => q[ ], 'no_proxy' => q[], 'pager' => q[less], 'prerequisites_policy' => q[ask], 'proxy_user' => q[], 'scan_cache' => q[atstart], 'shell' => q[/bin/sh], 'tar' => q[/usr/bin/tar], 'term_is_latin' => q[0], 'unzip' => q[/usr/bin/unzip], 'urllist' => [q[http://cpan.llarian.net/], q[ftp://cpan.nas.nasa.gov +/pub/perl/CPAN/], q[ftp://cpan.pair.com/pub/CPAN/], q[ftp://ftp.duke. +edu/pub/perl/], q[ftp://ftp.cs.colorado.edu/pub/perl/CPAN/], q[ftp:// +ftp.sunsite.utk.edu/pub/CPAN/], q[http://www.perl.com/CPAN/]], 'wait_list' => [q[wait://ls6.informatik.uni-dortmund.de:1404]], 'wget' => q[/usr/bin/wget], }; 1; __END__

When I run my program, however, all I get is

Working... CPAN: Storable loaded ok
Checking to see if the GD module has been installed, I find that it has not.

Any assistance would be appreciated. Thanks!


In reply to Remotely install modules by indiansummersky

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.