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

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

    Already answered and accepted answer - but anyway:

    IMHO the easiest way installing CPAN modules (on unix like systems, and have no idea about the wondows) is:

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

    The above is installing the "zero configuration CPAN modules installer" called cpanm. (Can take several minutes to install - don't break the process)

    and after - simply:

    cpanm Foo
    cpanm Module::One
    cpanm Another::Module
    

提交回复
热议问题