是否需要通过CPAN分发安装非Perl文件? [英] Non Perl files that need to be installed with CPAN distribution?

查看:44
本文介绍了是否需要通过CPAN分发安装非Perl文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的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:

  • If you use Dist::Zilla, you use its ShareDir plugin, which has an undocumented dir parameter that defaults to share.

用于 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆