Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

how ship perl in my application?

by xiaoyafeng (Chaplain)
on May 11, 2012 at 07:55 UTC ( #969929=perlquestion: print w/replies, xml ) Need Help??
xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:

Perl has many convenient feature to manipulate string e.g. re. So I embed a perl interpreter in C program and runs fine by far.

But the problem is a perl distribuition(active perl) is too large(about 24M). nobody wants a 20k program with a 24M package. sadly, a warning in embedperl destroy my naive thought:

Corollary: you can't use Perl from your C program unless Perl has been + compiled on your machine, or installed properly--that's why you shou +ldn't blithely copy Perl executables from machine to machine without +also copying the lib directory.)
So I ask here guru for help, is there a easier way to ship minimal perl in my application?(just copy perl executable and CORE directory etc) TIA.

I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Replies are listed 'Best First'.
Re: how ship perl in my application?
by Corion (Pope) on May 11, 2012 at 08:11 UTC

    On Windows, you can simply copy the Perl executable and the surrounding files around. The only thing to patch is if you care about other tools finding the correct directories.

    Stripping modules from the Perl distribution is something I don't like, but if you want to do that, you'll have to then hunt down all the dependent module files and copy them along.

      Thanks, Corion!

      I compiled a toy program embed in perl link with perl512.lib, and rename perl directory then copy perl512.dll in the same directory where program is, the program works fine.

      But the coming problem is how ship modules? I'd like put those in the specific directory instead of C:\perl

      I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

        I think the Perl interpreter will look in a sibling directory to the executable:

        C:\Programs\xiaoyafeng_perl\bin\xyf_p.exe C:\Programs\xiaoyafeng_perl\site\...

        ... but you can also in interpreter startup push directories onto @INC to make the Perl interpreter search there.

Re: how ship perl in my application?
by Anonymous Monk on May 11, 2012 at 08:13 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://969929]
Approved by Corion
Front-paged by Old_Gray_Bear
[ozboomer]: Howdy, all.. Trying this once more... Not really a perl question :(... but I don't know how to even title my query (more...)
[ozboomer]: There's a text file with lots of sections in it, like an '.ini/.conf' file. Each section can be 'used' or 'unused' by its application (more...)
[ozboomer]: Some folk want to use the text file as 'storage', keeping ALL items in it (a database); others call it an 'active document' that should only contain 'in-use' sections. Is there a 'good practice' for this sort of thing?

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2018-05-21 00:23 GMT
Find Nodes?
    Voting Booth?