Non Perl files that need to be installed with CPAN distribution?

天大地大妈咪最大 提交于 2020-02-14 09:44:12

问题


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?


回答1:


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 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.

  • For Module::Build, you use the share_dir parameter.

  • For Module::Install, you use the install_share command.

  • ExtUtils::MakeMaker doesn't have built in support, but you can use the File::ShareDir::Install module to add it.



来源:https://stackoverflow.com/questions/7264161/non-perl-files-that-need-to-be-installed-with-cpan-distribution

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!