Assuming you're running win32, check out the Activestate documentation for their perl distribution, specifically for "PerlEz - Perl Host DLL". Free. It's way cool. You basically instantiate a perl object, then feed it a perl script. Works, especially if your script will change based on conditions in your c++ program. On the other hand, the perl development kit (not free) allows you to create com dlls with actual methods, properties, etc. That works too.
If you're not on win32, sorry.
How can I embed perl in a C++ program?
I'm not sure you can. You might be able to compile the perl, and call an external routine, but the only language that I am certain can be embedded in C++ is assembly. Unless you have a special compiler that allows this, I think you'll have to call it as an external file.
That said, you could write your own macros to emulate the perl functionality, and then you could write "perl" in C++. I know one programmer who did this so he could use Pascal in C.
Reply:AC rocks :p
flower arrangement
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment