Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I embed Perl inside a C++ application?

Tags:

c++

perl

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.

like image 999
Brian R. Bondy Avatar asked Sep 08 '08 04:09

Brian R. Bondy


People also ask

Does Perl compile to C?

Since version 5.005, Perl has shipped with a module capable of inspecting the optimized parse tree ( B ), and this has been used to write many useful utilities, including a module that lets you turn your Perl into C source code that can be compiled into an native executable.

How Perl is executed?

Perl is a fairly straightforward, widely known and well-respected scripting language. It is used for a variety of tasks (for example, you can use it to create the equivalent of DOS batch files or C shell scripts), but in the context of Web development it is used to develop CGI scripts.


2 Answers

You can embed perl into your app.

  • Perl Embedding by John Quillan
  • C++ wrapper around Perl C API
like image 62
aku Avatar answered Sep 18 '22 14:09

aku


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.

like image 32
Leon Timmermans Avatar answered Sep 20 '22 14:09

Leon Timmermans