tags:

views:

664

answers:

3

I would like to call Perl script files from my c++ program.

I am not sure that the people I will distribute to will have Perl installed.

Basically I'm looking for a .lib file that I can use that has an Apache like distribution license.

+7  A: 

You can embed perl into your app.

aku
+4  A: 

I'm currently writing a library for embedding Perl in C++, but it's not finished yet. In any case I would recommend against using the EP library. Not only has it not been maintained for years, but is also has some severe architectural deficiencies and is rather limited in its scope. If you are interested in alpha software you can contact me about it, otherwise I'd advice you to use the raw API.

Leon Timmermans
+1  A: 

To call perl from C++ you need to use the API, as someone else mentioned; the basic tutorial is available in the perlxstut documentation.

Note that you will most probably need more than just a ".lib", because you'll need a lot of tiny modules which are located in the "lib" directory of the perl distrib: strict.pm, etc. That's a not a big deal though, I guess; the apache example you mentioned has the same constraint of delivering some default configuration files etc.

However, to distribute Perl, on Windows (I guess you're on Windows since you mentionned a .lib file), the ActiveState distribution which everyone uses might cause some licensing headache. It's not really clear to me, but it seems like you cannot redistribute ActivePerl in a commercial product. Note that, if you want to embed Perl in a C++ program, you might have to recompile it anyway, to have the same compilation flags on Perl and on your program.

Strawberry Perl doesn't have the same restrictions as ActivePerl (and not everyone uses ActivePerl).
brian d foy