hsi88 has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to install GD into Perl. They have a .tar.gz file which I promptly downloaded. Then I followed the CPAN instructions and entered the command from the shell: install gd

didn't work, so I moved the downloaded GD file into several Perl libraries thinking that was the problem. I tried the .tar.gz file and also unzipped the file and moved the contents into several Perl libraries like \perl\lib.

This is what I get:

cpan5> install gd

Use of uninitialized value $_[0] in string eq at I:/xampp/perl/lib/File/Spec/Win 32.pm line 152, <FIN> line 5.
Warning: no success downloading '\xampp\perl\bin\.cpan\sources\authors\01mailrc. txt.gz.tmp4984'. Giving up on it. at I:\xampp\perl\lib/CPAN/Index.pm line 225 Client not fully configured, please proceed with configuring.

You have not configured a urllist and do not allow connections to the internet to get a list of mirrors. If you wish to get a list of CPAN mirrors to pick from, use this command

o conf init connect_to_internet_ok urllist

If you do not wish to get a list of mirrors and would prefer to set your urllist manually, use just this command instead

o conf init urllist

Any ideas? I am a novice with Perl. But I'm not sure why it would try to load 01mailrc? Also I should note that I tried doing the mirror thing and I couldn't connect to the internet from XAMPP.

Replies are listed 'Best First'.
Re: Trying to install GD into Perl
by locked_user sundialsvc4 (Abbot) on Oct 13, 2010 at 01:14 UTC

    Little did you know, but when you “found a .gz file and promptly downloaded it ...” you actually slipped-up.

    Even though the CPAN pages provide a direct download-location for the module source, it is normally not the proper procedure “to download that file in that way.”   (You couldn’t know...)

    The essential idea behind CPAN is that, when properly set up, you can tell it what you want to install, and it will download, test, and install not only the component that you requested, but any and all pre-requisites for it!

    This, however, presupposes that you have configured CPAN properly first.   Which, I am quite sure to say, you haven’t done (and of course, had no way to know to do).

    Let me now step back and leave it to other Monks to point you to the best sources of info on how to accomplish that step. . .

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Trying to install GD into Perl
by zentara (Cardinal) on Oct 13, 2010 at 13:02 UTC
    so I moved the downloaded GD file

    Just as a summary, for any newbies, who tend not to read the README's and FAQs... :-)

    The original manual way of installing a module, which you may have downloaded by web browsing at search cpan ; is to simply unpack it anywhere you want, run perl Makefile.PL, make, then as root, make install

    Alternatively, with the CPAN module, you can run as root

    perl -MCPAN -e shell
    which will give you a CPAN prompt
    cpan>
    at which you would type
    cpan> install GD
    then the CPAN module will find the best place to download the current GD module, and will unpack, build and install it from it's CPAN style directory tree in the user's ~/.cpan directory.

    Unless I'm in a hurry, I always manually download my modules and go thru the perl Makefile.PL,make,make test, su, make install routine. I do this mostly because I like to have easy access to the module's sources in a single directory, rather have it hidden in the labyrinth of A-Z subdirs used to catalog authors and sources.

    Of course there are more difficult to understand refinements, like installing modules to your home directory, instead of su'ing to root to do the "make install". The easiest way to do that, is with the local::lib module, with which you can as a simple user do

    perl -MCPAN -Mlocal::lib -e shell
    then
    cpan > install GD
    will install to your own home directory without needing root privileges.

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
Re: Trying to install GD into Perl
by Anonymous Monk on Oct 13, 2010 at 20:41 UTC

    Hi hsi88.

    Try using your operating system's package manager to first get libgd, and then get the gd perl module. Install both of those using your OS package manager (on Debian or Ubuntu that's going to be aptitude). This will install the gd perl module into your system Perl's site_perl directory.

    Once you get more experienced, you might build and install your own Perl, and then use cpanm (App::cpanminus) to install Perl modules.