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

I'm getting my sea legs with perl -- -- winxp with ActiveState -- and today I would like to ask the monks a question about cpan. I do
cpan install stuff::thing
and get a bunch of output while the module attempts to install. Many lines of the output read something like
subroutine _STUFF redefined at /dir/dir/dir line 1234
Then scary messages like "no response from server, trying again." And in the end, everything works. At least, everything has worked so far.

But when my computer casually tells me that hundreds of functions are being redefined, I worry a bit. What's up with that? Am I being paranoid? Should I learn to love CPAN and not sweat the details?

Or should I back up my installation before every new grab from CPAN?

Here are more questions, while my cpan install grinds on, and my mind glazes over pondering the CPAN voodoo.

1) When should I use

make make test make install
and when should I use cpan install?

2) How long should I give CPAN install to succeed, before giving up? The error message I usually get many many many times, before it finally succeeds is usually

connecting to ftp.server.com logging in as anonymous, okay, okay, okay (skipped some stuff here) ..... ==> PORT ... Error in server response, closing control connection. Retrying.
3) My original question, are these "redefined function" actions of cpan dangerous?

Thanks for your wisdom!

thomas.

PS In this specific case it is log::log4perl, but this overall behavior is pretty constant with cpan, in my experience. PPS Here is my attempt at a google search to do my own research on the problem, but it didn't get me too far:

http://www.google.de/search?hl=de&q=cpan+%22error+in+server+response%22&btnG=Google-Suche&meta=

Replies are listed 'Best First'.
Re: CPAN "install" redefines bunches of stuff. Should I worry?
by pernod (Chaplain) on Dec 14, 2004 at 15:05 UTC

    I've never had any problems with the redefine statements from CPAN on a similar setup. Then again, maybe I'm foolhardy?

    When should I use
    make make test make install

    When you have a working make and C-compiler that will build Perl for you. I used to have Activestate Perl on Windows XP, but a few weeks ago I compiled Perl 5.8.5 from scratch to get access to Devel::Cover on windows. Had to fiddle around a bit, but I got it up and running with MinGW's C-compiler and dmake.

    The incantation above can be used as a fallback in case CPAN doesn't work right out of the box. When I compiled Perl i had to install a few modules with the make/make test/make install routine before I managed to bootstrap CPAN. After getting the initial modules though, things worked fine. Normally, you shouldn't need compile modules manually.

    Just (rambling) my $.02

    Update: Fixed a typo and some bad grammar

    pernod
    --
    Mischief. Mayhem. Soap.

Re: CPAN "install" redefines bunches of stuff. Should I worry?
by mpeters (Chaplain) on Dec 14, 2004 at 15:48 UTC
    As far as the errors that come from connecting to the servers, you might try adjusting the list of servers your install of CPAN uses. You'll have to modify the urllist parameter in the CPAN::Config module. Next time you run a cpan install take notice of which servers you connect to more easily and move them up in this list.

    Another possible source of the "redefined functions" messages is that some module that you are installing is redefining one of it's own functions during a test, etc. This isn't uncommon with modules that do dynamic function generation (Class::DBI, etc). Just a thought.
Progress, but no solution
by tphyahoo (Vicar) on Dec 14, 2004 at 14:58 UTC
    CPAN suggested I try i /log::log4perl/ so I did. This seems to be trying to connect to various servers without actually doing the install (??). I get the same messages, server refuses connection, but it fails much faster. I also needed to turn off my firewall to get it to fail quickly, so maybe my firewall has something to do with it. I also got that the urls in my configuration file might be invalid. Can anyone point me to a tutorial that could help me get these problems sorted out? best regards, thomas.
Re: CPAN "install" redefines bunches of stuff. Should I worry?
by Anonymous Monk on Dec 14, 2004 at 15:19 UTC
    This happens when CPAN.pm detects there is a newer version of CPAN.pm living on CPAN, and then goes to install and activate the newer version. I haven't happen that to me for a long time (nowadays it seems there are no updates to CPAN.pm outside of regular perl releases), and in my experience, it first asks whether it should be upgrade. But there might be a configuration switch to do it automatically.
Should have been ppm, not cpan.
by tphyahoo (Vicar) on Dec 14, 2004 at 15:57 UTC
    Still stumbling toward the light... All right, first of all, for activestate on winxp

    http://aspn.activestate.com/ASPN/docs/ActivePerl/faq/ActivePerl-faq2.html#repositories

    is what I should have read first. I am not sure what the "cpan" module/command does. However, I am slowly concluding that the program I should be using to install stuff is called with "ppm" not cpan.

    So, I do ppm, then the same command

    install log::log4perl
    I get "searching for this module returned no results" or something to this effect. I now believe my ppm is not configured with a repository that contains this module. I do the "rep" command, and learn that I have two repositories, active state repositories, I guess they come installed by default. I now would like to identify a repository that has what I want and add it to the other two repositories. But how?

    http://search.cpan.org/~mschilli/Log-Log4perl-0.49/

    doesn't help... so still mulling...

Problem Solved. Use - not ::
by tphyahoo (Vicar) on Dec 14, 2004 at 16:20 UTC
    Okay, the solution is as follows.

    As before, use ppm not cpan.

    In ppm, use

    install log-logger
    not
    install log::logger
    I still would like to know how to locate repositories that contain particular CPAN modules, but I didn't have to do that for log4perl, so I guess I'll leave this for another day.

    thanks for your help!

    thomas.

      Hi Thomas,

      PPM definitely makes installation easier under Windows. In order to find the modules you're looking for, you can type the following at the PPM prompt:

      search module_name

      So, in the case of your 'log-logger' module, you could type:

      search log-logger

      and you would get

      Searching in Active Repositories 1. Log-Logger [1.01] OO interface to user defined logfile 2. Log-Logger [1.01] OO interface to user defined logfile

      To install, you then type the 'install' command along with the name, or number, of the module.

      In addition, type 'help' at the PPM prompt to get a listing of the commands available. :)

      HTH,

      /Larry

      install Log::Logger should work aswell...

      Also, try (re-)installing/upgrading the CPAN module (use install Bundle::CPAN or do it manually). If I read all the previous post then this error occures when the CPAN version you have installed is outdate... It might failt to upgrade it...

      As a side note, you can find ppm-repositories servers for a module on http://kobesearch.cpan.org