Perl (Scripting) - Uninstall a module using cpanm

by
Jeremy Canfield |
Updated: February 01 2025
| Perl (Scripting) articles
Before uninstalling a module, you may want to use the instmodsh command to determine if the module is installed.
~]# instmodsh
Available commands are:
l - List all installed modules
m <module> - Select a module
q - Quit the program
cmd? l
Installed modules are:
Alien::Build
Alien::GMP
Alien::m4
Capture::Tiny
Crypt::Curve25519
Crypt::IDEA
CryptX
Digest::BubbleBabble
ExtUtils::MakeMaker
FFI::CheckLib
File::Which
File::chdir
Math::GMP
Math::Int64
Mojo::DOM58
Net::SFTP
Net::SSH::Perl
Path::Tiny
Perl
Sort::Versions
String::CRC32
Test::Simple
install
local::lib
cmd? q
The cpanm command with the --uninstall flag can be used to uninstall a module.
cpanm --uninstall Log::Log4perl
The --local-lib option can be used to point to a specific directory if the module is installed in a non-standard directory.
cpanm --uninstall --local-lib /path/to/my/perl/modules Log::Log4perl
Did you find this article helpful?
If so, consider buying me a coffee over at