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

Dear perl monks, I am a user of 10.6.8 snow leopard, and I have been willing to use perl for a very long time, however throughout this whole year i could not get perl to work for me and decided to give up on it. Until I purchased a new laptop and made it run on linux in which perl worked, cpan could even install everything. Thus I want to try again and make perl work on my mac. The main problem with perl on the mac was I could not install anything succesfully, now it gives me this response when i try to install cpanminus which is completely full of errors. I had macports installed before and i still have perlbrew installed, I can not find this folder /Users/bert/.cpan it does not appear in finder. I am sorry this question is getting rather chaotic but unfortunately i have no clue what to do. I want to install a perl with cpan on my desktop which will install it there so i dont have to see that Yaml is not installed and that it tries to install 8 dependencies unsuccesfully. I have a perl now in a folder called mydir and it has a lot of module files even the yaml it always claims not to find/mydir/perl/lib/perl5/CPAN/Meta/YAML.pm. If i can give you anymore information I am very willing to supply it, I have both Xcode installed as x11

Replies are listed 'Best First'.
Re: Fresh perl install
by frozenwithjoy (Priest) on Jul 04, 2012 at 20:08 UTC
    Do you have the optional Command Line Tools for Xcode installed? If not, follow the instructions for the top answer here.

    What happens if you type which make in Terminal?

      /usr/bin/make I don't know whether i installed command line tools, in the xcode preferences there isn't a downloads section i have xcode 4.0.2. Can I check whether i have installed command line tools? Thanks for looking into this:)
        The current version of Xcode is 4.3.3; however, I doubt that's the issue. Given that you have a make in your PATH, I suspect that Commanf Line Tools is not the issue either. Did you happen to look at the logs after the failed installs to see what the error was? Do you remember whether you installed perlbrew and cpanm in your home directory as per perlbrew.pl's instructions?
Re: Fresh perl install
by locked_user sundialsvc4 (Abbot) on Jul 05, 2012 at 14:18 UTC

    (Great puzzlement ...)   I simply source-code installed the latest Perl into /usr/local, after setting up my system with a case-insensitive file system for other reasons.   Then, it is pretty much identical to any other scenario of “installing packages as a non-root user...”   I encountered absolutely no unusual issues installing Perl and/or various CPAN libraries onto “this particular Unix variant,” and never had to use elevated privileges for anything.   I can’t imagine why you felt that you had to go to this much trouble.   (Of course, the system-provided Perl environment remained studiously untouched, once again “as is always standard practice.”)

      I know it sounds completely ridiculousxD, but it did work for me:) Since the fresh new modules even work without switching to the new perl install it must have been the old cpan, the new one works effortless with the App:Cpanminus. I am relatively new to perl, since i could never study packages for i could never use them thats why I might be wrong:S Is the use of smiles inappropriate on these fora? If so I will refrain from using them.
Re: Fresh perl install
by locked_user sundialsvc4 (Abbot) on Jul 06, 2012 at 16:51 UTC

    Since I have been asked, let me briefly elaborate ...

    Every version of OS/X has some “standard” version of Perl installed, and in the case of the Snow Leopard --> Lion upgrade it was actually quite a switch.   As is the case with every Unix-like operating system, you are sure to encounter some software (vendor-supplied or otherwise) which has been tested against that particular version of Perl, such that there might be very serious consequences indeed if it were changed in any way.   Therefore, you can’t change it; you mustn’t.

    But you can do what you can do in the garden-variety situation that has been re-hashed many times in the scenario of needing to run a different version of Perl than your shared-hosting provider uses.   You install your chosen version of Perl locally (e.g. in /usr/local or in your home-account), perhaps by compiling a source distribution directly.     One of the things that you can do at this point is to set the “built-in” set of @INC directories, and here you probably want to configure your local Perl executable so that it does not include built-in references to the system-wide directories at all.   You compile and install this from-source version.   Then, you arrange for PATH to point to this Perl binary in preference to your own.   Finally, you arrange for PERL5LIB to point to a local directory as “your CPAN repository,” and you set up a CPAN configuration to refer to that directory.   Now, you install into this location everything that you need.

    What you have now done, as long as both PATH and PERL5LIB are properly set, is to create an entirely-isolated Perl installation that not only consists of precisely the Perl version that you wish, but also that refers only to the CPAN libraries that you wish for it to see, as though nothing else existed.   (Because, from its point-of-view, they don’t.)

    On OS/X or any other system, I always define one (non-privileged) user account as “the user-level software maintenance account,,” such that I do all such software maintenance using that account (and do nothing at all there, other than that).   “Local software” directories are read/write accessible only to that user.