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

I think I have learned my lesson that I should NOT follow what seems to be CPANs great advice to upgrade using CPAN. All sorts of havok have been wrought.

Next problem: I'm adding some ftp functionality to a script, using Net::FTP. I already had Net::FTP installed, and it's the most current version. When I call the module (use Net::FTP;) I get the following error:

Can't locate NET/FTP.pm in @INC (@INC contains: /usr/lib/perl5/5.6.1/i686-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i686-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl) at /var/www/cgi-bin/xicontrol.cgi line 29. BEGIN failed--compilation aborted at /var/www/cgi-bin/xicontrol.cgi line 29.

The problem is, Net/FTP.pm is in two of those directories. Doing a locate FTP.pm yeilds:

/usr/lib/perl5/site_perl/5.6.0/Net/FTP.pm
/usr/lib/perl5/site_perl/5.6.1/Net/FTP.pm

Suggestions? I'm running Debian Woody.

  • Comment on Yet another strange problem with Perl upgrade

Replies are listed 'Best First'.
Re: Yet another strange problem with Perl upgrade
by shotgunefx (Parson) on Jul 08, 2002 at 21:40 UTC
    Are you using Net::FTP or NET::FTP? It looks like the later.

    -Lee

    "To be civilized is to deny one's nature."
      Well, don't I feel like a SFI (that stands for Stupid F*cking Idiot.). Just a typo calling NET::FTP instead of Net::FTP. Thanks!!
        No problem. I'm sure everyone makes that mistake at least once.

        -Lee

        "To be civilized is to deny one's nature."
Same problem, different module (LWP)
by Anonymous Monk on Jul 08, 2002 at 22:29 UTC
    I'm getting the same error, only with "use LWP::UserAgent;"

    It works fine when I "use LWP::Simple" or just "use LWP," but for one reason or another, it doesn't let me do any more advanced work with LWP.

    Any suggestions would be greatly apreciated.

    -X
      Check your spelling. It's LWP::UserAgent. The other thing if it works under the shell but not under CGI (or vice-versa), it could be you are using perl-run and Apache has been linked with a different version of perl. I had that happened once and it took me a bit to figure it out.

      -Lee

      "To be civilized is to deny one's nature."
        I am - for now - just running through the shell. When I run Perl command line and type my program in (it checks line-by-line, as you recall), I get the following:
        use LWP::UserAgent; Can't locate URI.pm in @INC (@INC contains: /usr/lib/perl5/5.6.1/i586- +linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i586-linux +/usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl .) at (eval 1 +) line 3. Compilation failed in require at /usr/lib/perl5/5.6.1/HTTP/Request.pm +line 39. Compilation failed in require at /usr/lib/perl5/5.6.1/LWP/UserAgent.pm + line 108.BEGIN failed--compilation aborted at /usr/lib/perl5/5.6.1/L +WP/UserAgent.pm line 108. Compilation failed in require at - line 1. BEGIN failed--compilation aborted at - line 1.
        I don't know what would cause it to do this, but for one reason or another, I can't use LWP::UserAgent, or just use LWP. I'm stumped :-/ -X
      it doesn't let me do any more advanced work with LWP
      Which translates as? You can't pull in any of the other LWP modules? That would be odd, since LWP::Simple relies on them and wouldn't work if they didn't..

      Makeshifts last the longest.