user391986
user391986

Reputation: 30906

how do I link PerlIO Perl package without "installing it"

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

Upvotes: 0

Views: 490

Answers (2)

daxim
daxim

Reputation: 39158

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;

Then, in your main program use blib 'inc/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.

Upvotes: 3

choroba
choroba

Reputation: 241908

It depends on which machines you plan to install it. If all of them have the same operating system (and the same versions libraries and Perl and so on), it might be possible. If not, you need to compile the module for each planned platform beforehand (it contains some .xs files).

Upvotes: 1

Related Questions