How do I get a list of installed CPAN modules?

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

    You can try ExtUtils-Installed, but that only looks in .packlists, so it may miss modules that people moved things into @INC by hand.

    I wrote App-Module-Lister for a friend who wanted to do this as a CGI script on a non-shell web hosting account. You simple take the module file and upload it as a filename that your server will treat as a CGI script. It has no dependencies outside of the Standard Library. Use it as is or steal the code.

    It outputs a list of the modules and their versions:

    Tie::Cycle      1.15
    Tie::IxHash     1.21
    Tie::Toggle     1.07
    Tie::ToObject   0.03
    Time::CTime     99.062201
    Time::DaysInMonth       99.1117
    Time::Epoch     0.02
    Time::Fuzzy     0.34
    Time::JulianDay 2003.1125
    Time::ParseDate 2006.0814
    Time::Timezone  2006.0814
    

    I've been meaning to add this as a feature to the cpan tool, so I'll do that too. [Time passes] And, now I have a -l switch in cpan. I have a few other things to do with it before I make a release, but it's in github. If you don't want to wait for that, you could just try the -a switch to create an autobundle, although that puts some Pod around the list.

    Good luck;

提交回复
热议问题