Perl 使用CPAN安装Dancer和依赖项

Perl 使用CPAN安装Dancer和依赖项,perl,perl-module,cpan,dancer,Perl,Perl Module,Cpan,Dancer,我正在尝试使用Dancer创建一个示例web服务。我使用Ubuntu 10.04作为我的操作系统。我使用CPAN客户端安装了Dancer和dependencies,也可以这样做 dancer -a MyApp 但是,当我尝试运行app.pl文件时,代码抛出一个错误,表示YAML.pm找不到。我确信此文件是在安装依赖项时下载的。A我有几个问题:- 1. Where does CPAN put all these files which were downloaded? How are they

我正在尝试使用Dancer创建一个示例web服务。我使用Ubuntu 10.04作为我的操作系统。我使用CPAN客户端安装了Dancer和dependencies,也可以这样做

dancer -a MyApp
但是,当我尝试运行app.pl文件时,代码抛出一个错误,表示YAML.pm找不到。我确信此文件是在安装依赖项时下载的。A我有几个问题:-

1. Where does CPAN put all these files which were downloaded? How are they included in the @INC?
2. For using Dancer, do I have to manually include all the files in @INC?
我试图通过在@INC中包含dancer.pm路径来创建一个非常简单的perl dancer应用程序says hello world。但是,由于缺少某些依赖项或其他依赖项,它一直失败


帮助我理解我做错了什么?

cpan应该将文件放在@INC的路径之一
perl-E'$“=”\n;说“@INC”

我的系统上的输出:

/etc/perl
/usr/local/lib/perl/5.14.2
/usr/local/share/perl/5.14.2
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.14
/usr/share/perl/5.14
/usr/local/lib/site_perl
.
cpan将文件放在/usr/local/share/perl/5.14.2中

因为该路径存在于@INC中,所以您不应该手动将其包括在内。至于Dancer,YAML对它不是硬依赖关系,因为它没有安装。

在Github上的Dancer的问题跟踪程序中也可以看到这个接受答案。这是我一直在寻找的。另外,当我说“使用Dancer”:syntax时,我没有看到抛出错误。是否有任何解释hy?因为Dancer.pm不需要YAML本身。只有几个子模块需要YAML:Dancer::Session::YAML、Dancer::Config、Dancer::Serializer::YAML。我认为当您说使用Dancer:'语法'时,这些子模块不会加载