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

前端 未结 24 2644
情深已故
情深已故 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:33

    Try App::cpanminus:

    # cpanm Chocolate::Belgian
    

    It's great for just getting stuff installed. It provides none of the more complex functionality of CPAN or CPANPLUS, so it's easy to use, provided you know which module you want to install. If you haven't already got cpanminus, just type:

    # cpan App::cpanminus
    

    to install it.

    It is also possible to install it without using cpan at all. The basic bootstrap procedure is,

    curl -L http://cpanmin.us | perl - --sudo App::cpanminus
    

    For more information go to the App::cpanminus page and look at the section on installation.

提交回复
热议问题