What's the easiest way to install a missing Perl module?

前端 未结 24 2718
情深已故
情深已故 2020-11-21 05:28

I get this error:

Can\'t locate Foo.pm in @INC

Is there an easier way to install it than downloading, untarring, making, etc?

24条回答
  •  失恋的感觉
    2020-11-21 05:36

    Use cpan command as cpan Modulename

    $ cpan HTML::Parser
    

    To install dependencies automatically follow the below

    $ perl -MCPAN -e shell
    cpan[1]>  o conf prerequisites_policy follow
    cpan[2]>  o conf commit
    exit
    

    I prefer App::cpanminus, it installs dependencies automatically. Just do

    $ cpanm HTML::Parser
    

提交回复
热议问题