Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

Comment on how ship perl in my application?
Download Code
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 Config.pm 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?
Username:
Password:

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
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-09-01 22:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (17 votes), past polls