in reply to My cpan is very broken

Suggestion: try plenv - it makes it simple to install and use other Perls apart from the system Perl (this is generally much safer than tinkering with the system Perl).

It is easy to install

Once you've done that, you can use it to install cpan minus
plenv install-cpanm
Then
% cpanm File::TreeBuilder --> Working on File::TreeBuilder Fetching http://www.cpan.org/authors/id/L/LU/LUCS/File-TreeBuilder-0.0 +2.tar.gz ... OK Configuring File-TreeBuilder-0.02 ... OK ==> Found dependencies: Test::Usage --> Working on Test::Usage Fetching http://www.cpan.org/authors/id/L/LU/LUCS/Test-Usage-0.08.tar. +gz ... OK Configuring Test-Usage-0.08 ... OK ==> Found dependencies: IO::Capture::Stderr, File::Slurp, IO::Capture: +:Stdout --> Working on IO::Capture::Stderr Fetching http://www.cpan.org/authors/id/R/RE/REYNOLDS/IO-Capture-0.05. +tar.gz ... OK Configuring IO-Capture-0.04 ... OK Building and testing IO-Capture-0.05 ... OK Successfully installed IO-Capture-0.05 --> Working on File::Slurp Fetching http://www.cpan.org/authors/id/C/CA/CAPOEIRAB/File-Slurp-9999 +.32.tar.gz ... OK Configuring File-Slurp-9999.32 ... OK Building and testing File-Slurp-9999.32 ... OK Successfully installed File-Slurp-9999.32 Building and testing Test-Usage-0.08 ... OK Successfully installed Test-Usage-0.08 Building and testing File-TreeBuilder-0.02 ... OK Successfully installed File-TreeBuilder-0.02 4 distributions installed