Uninstall all perl modules installed by cpan

后端 未结 6 1720
耶瑟儿~
耶瑟儿~ 2020-12-09 09:05

Yesterday I wanted to test some software and in the documentation it said, to install I just needed to type

cpan -i Software

I never used

6条回答
  •  星月不相逢
    2020-12-09 09:08

    You can uninstall individual modules with cpanplus (ships with Perl) like this:

    cpanp uninstall SQL::Abstract
    

    You can view all modules installed with the cpan script like this:

    perldoc perllocal
    

    Putting the two together:

    for module in $(perldoc -u perllocal | grep -F 'C L<' | sed 's/^.*L<\(.*\)|.*>$/\1/') ; do
        cpanp uninstall "$module"
    done
    

提交回复
热议问题