On Thu, 3 Jun 2004, John Horner wrote:

> I'm a little unclear about which version of Perl I have, and/or which
> version of Perl is executed when I run scripts.
>
> If I do
>
>    perl -v
>
> I get the answer
>
>    This is perl, v5.8.0 built for darwin

Have you installed a copy of Perl then? The stock copy should be 5.8.1.

What do you get if you do a `which perl`?

If the answer is anything other than /usr/bin/perl, then you have
multiple copies of Perl installed, and the commands you're trying should
work if you explicitly use /usr/bin/perl (&/or get rid of the copy of
version 5.8.0 you have if you don't want it).

If the answer is /usr/bin/perl, you stock Perl has been overwritten. You
can either install a fresh copy of Perl into the same place, or you can
try reinstalling OSX (or manually copy the version of /usr/bin/perl off
your installation CDs, but that could get messy fast).

> but I just looked into the /System/Library/Perl folder and there's a
> "5.8.1" folder full of what looks like all the right stuff. If I have
> both 5.8.0 and 5.8.1 what do I do to invoke the newer version when I
> type "perl [scriptname]"?

If you have multiple versions -- and want multiple versions -- then you
can explicitly chooose one or the other by invoking them with a full
pathname rather than just the command name:

    /usr/bin/perl
    /usr/local/bin/perl
    /opt/bin/perl
    /usr/local/perl/5.8.3/bin/perl

etc.

> Also, where are the modules supposed to be and where does Apple think
> they should be? -- If I do
>
>    perl -Mnotamodule
>
> I get
>
> Can't locate notamodule.pm in @INC (@INC contains:
> /Library/Perl/darwin /Library/Perl /Library/Perl/darwin /Library/Perl
> /Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl
> /Network/Library/Perl .).
>
> so those are presumably the default locations, but does CPAN have the
> same defaults?

It should go by the @INC array, yes.

This could again come down to multiple copies of Perl installed.



-- 
Chris Devers

Reply via email to