How can I check if a Perl module is installed on my system from the command line?

前端 未结 10 1174
旧巷少年郎
旧巷少年郎 2020-12-07 14:33

I tried to check if XML::Simple is installed in my system or not.

perl -e \'while (<@INC>) { while (<$_/*.pm>) { print \"$_\\n\"; } }\'
         


        
10条回答
  •  Happy的楠姐
    2020-12-07 15:07

    What you're doing there is not recursing into directories. It is only listing the modules in the root directory of the @INC directory.

    The module XML::Simple will live in one of the @INC paths under XML/Simple.pm.

    What he said above to find specific modules.

    CPAN explains how to find all modules here, see How to find installed modules.

提交回复
热议问题