On Mar 11, 2007, at 9:57 AM, Joel Rees wrote:

On 平成 19/03/11, at 19:55, Sherm Pendley wrote:

What "it" are you talking about that "senses" Perl 5.8.8? The scripts you're trying to run? Something you're trying to install? Are you certain that it's "sensing" Perl 5.8.8? How are you certain of that?

The perl ./Configure and/or cpan. I couldn't find documentation on doing an uninstall, and when I tried to recompile with the binaries in place under /usr/local the ./Configure and/or cpan initialization scripts kept giving me bad results.

Sorry to be so vague, but if you're an IT vet,

Highly questionable these days. My memory for technical stuff seems to be going away.

No worries. The details change - languages, applications, APIs, etc. - but the mindset never changes. Everything that happens on a computer is always a direct cause->effect chain of events. At least, until we finally perfect quantum computers with three-state (yes/no/ maybe) logic. That'll be the day I start my new career as a carpenter. ;-)

you know the drill - troubleshooting is a methodical, step-by-step process, and you can't rely on guesswork for any step. Step one: Which Perl are your scripts running with #!?

I spent a little time building a .bash_profile script that would insert /usr/local/bin between /bin and /usr/bin. I then checked that calling perl from the command line gave me 5.8.8 instead of 5.8.6, which is the one in /usr/bin. I even noticed that apache, when run from the command line instead of the system preferences, had the altered path, so I'm pretty confident anything that picked up the path from the environment would have been getting the perl under /usr/local. Since I always told ./Configure and the cpan initialization script to install under /usr/local, or, rather, checked that the default was set to that and left it that way, I assume cpan should know where it's supposed to get perl from.

The admin user, rather than root, owns /usr/local during the compile and install, for what it's worth, so the install step was not sudone.

Anyway, nuking it from orbit did the trick, so I apologize for the noise. My dynamic dns script (which specifies /usr/local/bin/perl on the shebang line)

The shebang line is what I was asking about. I wish I had a dime for every time someone has posted here, having installed a new Perl, but finding that their "new" Perl couldn't find its own modules. Invariably, the problem is that the #! line is still pointing to /usr/ bin/perl.

Apache doesn't normally need the $PATH. If you're using mod_perl, the full path to libperl is hard-coded at build time. And if you're using a CGI, the full path to the interpreter is needed in the #! line.

Anyway, no, CPAN doesn't know *anything* about multiple Perls, or how to figure out which Perl you want to install modules for. All it knows about is the Perl it's running with - that's the one it will install modules for. If you run CPAN with /usr/local/bin/perl -MCPAN - e shell, you'll get modules installed to that Perl. If you run it with perl -MCPAN -e shell, then Bash will use the $PATH to figure out which perl to run, and that will be the one you wind up installing modules for.

If you're using the "cpan" shell script instead of "perl -MCPAN", have a look at that script's #! line.

Another thing to try - do a "!print $]" from in the CPAN shell. The "!" command is for evaluating arbitrary Perl code, and it's just an eval(), not a system(), so printing the version # that way will tell you what Perl is running the CPAN shell.

I assume that there is an official way to uninstall perl that I just haven't been finding? (I have vague memories of doing so several years ago, but I sure couldn't find it this time.)

None that I know of. Which is annoying, because the install puts stuff all over the place - $prefix/lib, bin/, and man/, at least. I generally use a unique prefix for each Perl install, just so I can cleanly delete the whole thing when I'm done with it.

sherm--

Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


Reply via email to