Last active
October 1, 2018 19:59
-
-
Save kberov/35ec4011dbcbf8b688191e90de3c11b4 to your computer and use it in GitHub Desktop.
Uninstall Perl modules installed via cpan or cpanm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# I tried this even wth my system perl because I had installed modules there | |
# For this you need to be root, but beware you can break your system, | |
# if you have important scripts using some of these modules | |
# get list of installed modules via `cpanm` or `cpan` | |
export PERLLOCAL=`find "$1" -name 'perllocal.pod'` | |
# find and uninstall installed modules. cpanm will propt for each one | |
cpanm -U `perl -ne 'print "$1 " if /L\<([^\|]+)\|/' $PERLLOCAL` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment