我刚刚在 Ubuntu 12.04 上花了一个小时解决完全相同的问题,终于弄明白了。我已经安装了 libapache2-mod-perl2 :
$ sudo apt-get install libapache2-mod-perl2
Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-perl2 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
尽管如此,当我尝试通过 cpan 安装 Apache2::Const 模块时,我一直收到同样的错误:
$ cpan Apache2::Const
Going to read '/home/jdoe/.cpan/Metadata'
Database was generated on Sun, 27 Apr 2014 08:29:02 GMT
Warning: Cannot install Apache2::Const, don't know what it is.
Try the command
i /Apache2::Const/
to find objects with matching identifiers.
当安装 libapache2-mod-perl2 时,我终于发现 Apache2::Const 已经安装(我想是二进制):
$ perl -MApache2::Const < /dev/null
$
因此 Apache2::Const 不应该使用 cpan 安装。