如何在不“安装” PerlIO的情况下链接PerlIO Perl软件包? [英] how do I link PerlIO Perl package without "installing it"

查看:110
本文介绍了如何在不“安装” PerlIO的情况下链接PerlIO Perl软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试在不安装PerlIO :: eol软件包的情况下将其添加为项目的一部分,因此可以将所有依赖项与脚本打包在一起,而不必在每台计算机上都重新安装它们。
如何为 PerlIO :: eol
我不了解其结构以及重要文件的位置

I'm trying to add the PerlIO::eol package as part of my project without installing it, this way all dependencies can be packaged with my script without having to reinstall them on each machine. How can I do it for PerlIO::eol I don't understand the structure and where the important files are

推荐答案

创建子目录 inc ,然后将未包装的PerlIO-eol发行版移到那里。然后,在项目的 Build.PL 中使用以下内容:

Create a subdirectory inc and move an unpacked PerlIO-eol distro there. Then, use something like this in your project's Build.PL:

use Config qw(%config);
use Module::Build qw();

my $build = Module::Build->subclass(code => q(sub ACTION_inc2blib {
    my ($self) = @_;
    chdir 'inc/PerlIO-eol';
    system $^X, 'Makefile.PL';
    system $Config{make};
    chdir '../..';
}))->new(
    module_name     => 'Foo::Bar',
    license         => 'restrictive',
    dist_abstract   => 'blah',
);

$build->dispatch('inc2blib');
$build->create_build_script;

然后,在您的主程序中 使用blib'inc / PerlIO-eol';

Then, in your main program use blib 'inc/PerlIO-eol';.

但这就是 BFI ,您只需将PerlIO :: eol设置为项目发行版图元文件中的运行时依赖项并正常安装。

But that's BFI, you should simply set up PerlIO::eol as a runtime dependency in your project distro's metafile and have it installed normally.

这篇关于如何在不“安装” PerlIO的情况下链接PerlIO Perl软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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