Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Perl 为什么CPAN.pm在我只想要Mo的时候安装Moose?_Perl_Cpan_Metacpan - Fatal编程技术网

Perl 为什么CPAN.pm在我只想要Mo的时候安装Moose?

Perl 为什么CPAN.pm在我只想要Mo的时候安装Moose?,perl,cpan,metacpan,Perl,Cpan,Metacpan,我需要perl5脚本中的轻量级对象系统。在阅读了Mouse.pm、Moo.pm和Mo.pm的文档后,我在Moo和Mo之间翻来覆去。最终的决定因素是Mo模块已经(参见页面右侧-的“依赖项”灰显) 因此,我继续进行我认为简单的安装: User@Ubuntu-iMac:~$ perl -MCPAN -e shell Terminal does not support AddHistory. cpan shell -- CPAN exploration and modules installation

我需要perl5脚本中的轻量级对象系统。在阅读了Mouse.pmMoo.pmMo.pm的文档后,我在Moo和Mo之间翻来覆去。最终的决定因素是Mo模块已经(参见页面右侧-的“依赖项”灰显)

因此,我继续进行我认为简单的安装:

User@Ubuntu-iMac:~$ perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.05)
Enter 'h' for help.

cpan[1]> Terminal does not support GetHistory.
Lockfile removed.
User@Ubuntu-iMac:~$ sudo perl -MCPAN -e shell
[sudo] password for User: 
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.05)
Enter 'h' for help.

cpan[1]> install Mo
Reading '/home/User/.cpan/Metadata'
  Database was generated on Tue, 23 Feb 2016 02:17:02 GMT
Running install for module 'Mo'
Fetching with LWP:
http://www.cpan.org/authors/id/I/IN/INGY/Mo-0.39.tar.gz
Checksum for /home/User/.cpan/sources/authors/id/I/IN/INGY/Mo-0.39.tar.gz ok
Scanning cache /home/User/.cpan/build for sizes
............................................................................DONE
Configuring I/IN/INGY/Mo-0.39.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Mo
Writing MYMETA.yml and MYMETA.json
  INGY/Mo-0.39.tar.gz
  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for I/IN/INGY/Mo-0.39.tar.gz
---- Unsatisfied dependencies detected during ----
----            INGY/Mo-0.39.tar.gz           ----
    Moose [requires,optional]
    IO::All [requires,optional]
    Mouse [requires,optional]

 ... many lines of installation of dozens of modules deleted ...

所以我的问题是-为什么它认为它需要
鼠标
IO::All
,最痛苦的是,
驼鹿
?注:我可以看到上面写着[需要,可选]——但我认为这两个术语是矛盾的。

Mo发行版包括两个模块,Mo::Moose和Mo::Mouse,它们在引擎盖下使用Moose和Mouse。这些模块的测试要求安装Moose和Mouse。build_requires/requires/commandline指示它在哪里找到依赖项。“requires”在这里真正的意思是“dependency”。“Optional”表示它们是可选的依赖项(如您所见)。您已将
cpan
配置为不询问您是否要安装依赖项,因此它不询问就安装了它们。
Mo
。。。叹息
&{$M.$::e}($P,\%e,\%o,\@)for@_;如果$e{M}返回;%e=(扩展,sub{eval“no$\[0]()”;@{$P.ISA}=$\[0]},has,sub{my$n=shift;my$m=sub{$\\[0]{$n}=$\[1]:$\[0]{$n}…
让我难过。@Sinan它很美,不是吗?:)感谢您在安装过程中对CPAN.pm列出的依赖项所做的解释。我想这会提出一个问题,即为什么metapan.org上的依赖项会误导用户。