是否需要通过CPAN分发安装非Perl文件? [英] Non Perl files that need to be installed with CPAN distribution?
问题描述
我需要在我的CPAN发行版中安装不是Perl的文件。我应该把它们放在远方吗?以及从模块内引用它们的最佳方法是什么,以便无论用户配置如何都可以访问它们?
I need to have files installed with my CPAN dist that aren't Perl. Where in the dist should I put them? and what's the best way to reference them from within a module so that I have access to them regardless of users configuration?
推荐答案
好,您不清楚这些文件是什么以及如何使用,但是您可能正在寻找文件:: ShareDir 。
Well, you're not very clear on what these files are and how they're used, but you're probably looking for File::ShareDir.
File :: ShareDir仅负责对模块中文件的运行时访问。与模块一起安装文件的方式取决于所使用的安装系统:
File::ShareDir only takes care of the run-time access to the files from your module. The way you get the files installed along with your module depends on which install system you use:
-
如果使用 Dist :: Zilla ,则使用其 ShareDir 插件,该插件具有未记录的
dir
参数,默认为份额
。
If you use Dist::Zilla, you use its ShareDir plugin, which has an undocumented
dir
parameter that defaults toshare
.
用于 Module :: Build ,您使用 share_dir 参数。
对于 Module :: Install ,则使用 install_share 命令。
ExtUtils :: MakeMaker 没有内置支持,但是您可以使用文件:: ShareDir :: Install 模块将其添加。
ExtUtils::MakeMaker doesn't have built in support, but you can use the File::ShareDir::Install module to add it.
这篇关于是否需要通过CPAN分发安装非Perl文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!