How do I get a list of installed CPAN modules?

后端 未结 29 2207
盖世英雄少女心
盖世英雄少女心 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:48

    I wrote a perl script just yesterday to do exactly this. The script returns the list of perl modules installed in @INC using the '::' as the separator. Call the script using -

    perl perlmod.pl
    

    OR

    perl perlmod.pl  #Case-insensitive(eg. perl perlmod.pl ftp)
    

    As of now the script skips the current directory('.') since I was having problems with recursing soft-links but you can include it by changing the grep function in line 17 from

      grep { $_ !~ '^\.$' } @INC
    

    to just,

    @INC
    

    The script can be found here.

提交回复
热议问题