> perldoc cpanfile:
仅显示主要用途. “另请参阅”部分没有帮助.
> perldoc Module :: CPANfile:与cpanfile相同.
> perldoc cpanfile-faq:没有解释确切的语法或链接,只有
Familiar DSL Syntax
This is a new file type,but the format and Syntax isn’t entirely new.
The Metadata it can declare is exactly a subset of “Prereqs” in
CPAN Meta Spec.The Syntax borrows a lot from Module::Install. Module::Install is a
great way to easily declare module Metadata such as name,author and
dependencies. cpanfile format is simply to extract the dependencies
into a separate file,which means most of the developers are
familiar with the Syntax.
>网:我发现(但不回答我的问题)
> https://speakerdeck.com/miyagawa/cpanfile
> http://weblog.bulknews.net/post/44963580392/what-is-cpanfile-and-why-do-i-want-to-use-it
> http://blogs.perl.org/users/lestrrat/2013/03/the-main-problem-with-cpan-modules-on-github.html
有没有人知道在哪里找到cpanfile语法/格式的确切描述?
解决方法
Module::CPANFile
和perldoc cpanfile和perldoc cpanfile-faq可用.
cpanfile的POD表示:
[the] cpanfile specification (this document) is based on Ruby's Gemfile http://gembundler.com/man/gemfile.5.html specification.
cpanfile手册页面中的链接已损坏.应该指出:http://bundler.io/v1.3/man/gemfile.5.html
cpanfile旨在通过Module::Install
DSL语法“向后兼容”,并且可以转换为CPAN :: Meta :: Prereqs,并受到CPAN :: Meta Spec v.2等的启发.
据了解,cpanfile有些是“元格式”,适合于一系列TIMTOWTDI方法(参见miyagawa’s blog describing cpanfile
),与Module :: Install兼容,大部分是自我记录.例如,如果您在Meta文件的目录中运行myMeta-cpanfile,它将为您构建一个cpanfile;您可以编写一个描述CPAN :: Meta :: Prereqs,然后$file-> save(‘cpanfile’)的先决条件的脚本;写一个cpanfile.
至于Dist :: Milla,在教程中(参见Dist :: Milla中的POD
),miyagawa指出
“如果您决定手动构建新的cpanfile,该格式大多与Module :: Install的DSL要求兼容.本教程还提供了一个简短的例子.
我认为miyagawa要在分发文件中澄清cpanfile规范/格式的状态和用例是公平的.那几个例子可以回答像你这样的问题.他已经做了大部分工作 – 这不仅仅是在一个地方.