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

I'm having trouble installing anything at all from CPAN from the command line on my Mac. I'm new to Mac, so lacking in most basic knowledge. Everytime I try to install something, I get this message:
When trying to read that file I expected to get a hash reference for further processing, but got garbage instead. Proceed nonetheless? [no]
If I try to proceed, the install fails anyway. This happens with every single module I try to install. I've installed the latest CPAN manually, to see if that would make a difference, but nothing. I'm running as admin, so that shouldn't be a problem.

I'm sorry if this is a really obvious newbie question, but I'm at a loss. Please let me know if you need any more info from me in order to help me solve the problem.

Thanks so much, in advance!

Replies are listed 'Best First'.
Re: installing from CPAN "got garbage" error
by jeffa (Bishop) on Jun 19, 2014 at 16:53 UTC

    I use Perl Brew along with cpanm. Follow the directions and do some google searching and you should be up and running in no time. Feel free to come back here if you have specific errors you want to triage/resolve.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      http://learn.perl.org/installing/ -> http://learn.perl.org/installing/osx.html
      • Install "Command Line Tools for Xcode", either directly or through Xcode, both available from Apple Developer downloads (free registration required). Xcode can also be installed through the App Store application.
      • Open the Terminal.app (found in Applications -> Utilities) and copy & paste the command below into it (then press the 'return' key):
        curl -L http://xrl.us/installperlosx | bash
      • Once this is finished (it takes several minutes), quit the Terminal app.