Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Simple question: How to install CPAN modules on OS-X like normal Linux/Unix way?

I just want to type in cpan something like install Perl6::Say for example.

share|improve this question

2 Answers 2

You might be interested in perlbrew to manage local perl installations and cpan modules without interfering with perl included with the system or needing to use sudo to install cpan modules.

share|improve this answer
    
This is a very nice solution for someone that cares not to install Xcode or other command line tools. –  bmike Dec 18 '12 at 16:51
    
good solution, thanks! –  gaussblurinc Dec 18 '12 at 17:12

Open the /Applications/Utilities/Terminal.app and you have a unix prompt.

Both perl and cpan ship with OS X so you have nothing to install unless you want a different version of them than ships with your particular version and build of OS X.

Air:~ me$ cpan install Perl6::Say
Sorry, we have to rerun the configuration dialog for CPAN.pm due to
some missing parameters...  Will write to
 <</Users/me/.cpan/CPAN/MyConfig.pm>>
share|improve this answer
    
Depending on the modules you want to install you may need to install Xcode as well so a compiler is available. Install Xcode before running cpan for the first time. If you've already configured cpan you may need to re-run it with cpan config so it picks up the compiler. –  Ian C. Dec 18 '12 at 16:37
    
i'm trying, but always have status 'make or install: NO'. am i need to use sudo? but i want only for current user, not root all modules –  gaussblurinc Dec 18 '12 at 16:37
    
Why not ask a follow on question. List exactly the module you want to install and exactly the error message you get. You may be missing the command line tools that Xcode can install or you may have another error. We like narrow, specific, answerable questions here. It's free to ask another question, so why not leave this as a signpost for how to get started and ask another on how to interpret a specific error message. I'll edit my answer to show that with Xcode and the command line tools installed, this works for a user install. –  bmike Dec 18 '12 at 16:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.