Updating perl cpan
It runs a script to do this and provides defaults that are nearly always right so you can just run through the script accepting all of the defaults.
On Unix systems (including Mac OS) cpan retrieves source archives of modules and if necessary compiles them on your system.
That means that you will need at least a compiler and the basic development libraries for your system.
On Linux and BSD systems you may need to install these with your package manager.
When searching a Perl module, sooner or later you will end up on one of two sites sites providing information about CPAN modules.
Both Meta CPAN, and org will show you a link to download the module, but in most cases that's not what you need.
BEGIN failed--compilation aborted at /usr/share/perl5/CPAN/line 6. Compilation failed in require at /usr/share/perl5/line 27. Compilation failed in require at /usr/share/perl5/CPAN/line 6.