Removing perl module installed with cpanm

cpanperl

I am Perl beginner. I wanted to use Log::Log4perl module as I am familiar how it works in Java. I used cpanm script to download module, but I ran it without "sudo". Then it installed this module to my dir /home/amer/perl5. Afterwards, I installed it as sudoer, but I want to remove installation in my home dir to avoid any conflicts in future. How can I do that?
Here is my cmdline execution stack.

Thanks and Regards!

Best Answer

That's quite experimental for the moment being, but now cpanm supports an uninstall option. From MetaCpan :

-U, --uninstall

EXPERIMENTAL: Uninstalls the modules. Will remove the distribution files from your library path using the .packlist file. When used with -l or -L, only the files under the local::lib directory will be removed. NOTE: If you have the "dual-life" module in multiple locations (i.e. site_perl and perl library path, with perl 5.12 or later), only the files in site_perl will be deleted. If the distribution has bin scripts and man, they will be kept in case the core installation still references that, although there's no guarantee that the script will continue working as expected with the older version of .pm files.