How do I get a list of installed CPAN modules?

后端 未结 29 2106
盖世英雄少女心
盖世英雄少女心 2020-12-04 07:41

Aside from trying

perldoc 

individually for any CPAN module that takes my fancy or going through the file system and loo

29条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-04 07:51

    As you enter your Perl script you have all the installed modules as .pm files below the folders in @INC so a small bash script will do the job for you:

    #!/bin/bash
    
    echo -e -n "Content-type: text/plain\n\n"
    
    inc=`perl -e '$, = "\n"; print @INC;'`
    
    for d in $inc
    do
       find $d -name '*.pm'
    done
    

提交回复
热议问题