CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Need help to call perl module from C/C++ code without loading the perl libraries

 



muraliv
New User

Oct 2, 2012, 3:53 AM

Post #1 of 2 (1387 views)
Need help to call perl module from C/C++ code without loading the perl libraries Can't Post

Hi,

I am new to perl. I have a requirement to call a perl module from C/C++ code without loading the perl libraries. I am not supposed to use the "system" call also. I am looking something similar to "dlopen" call which we use to load the shared libraries dynamically from a C/C++ code. Basically I wanted to keep perl and C/C++ code independently. Generally we can embed the perl into C/C++ code by including the include files EXTERN.h and perl.h. While compiling the C/C++ code, we need to provide the perl libraries. As per my requirement, I am not supposed to provide any perl libraries while compiling the C/C++ code.

Any idea how to call perl module from C/C++ code without loading the perl libraries other than “system” call?

Thanks in advance.

Regards,
Murali


rovf
Veteran

Oct 17, 2012, 7:21 AM

Post #2 of 2 (923 views)
Re: [muraliv] Need help to call perl module from C/C++ code without loading the perl libraries [In reply to] Can't Post

If I understand you correctly, you want to have the Perl stuff run in a separate process from your C++ program. You did not provide any hint about what kind of data need to be sent between the two processes.

You can start your Perl process in parallel to your main program (i.e. independently), and then use a socket connection to have them talk to each other. Of course the tricky part is to pass the data around - you will have to do some type of marshalling -, but if the interface between the two is lean enough, this should be not too difficult.

Have a look at IO::Socket for the Perl side of the socket communication.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives