How to install CPAN modules from the command line on OS X?

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.


Solution 1:

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 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>>

Solution 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.