Hi all,
I am a newbie to perl and know nothing of Perl.
I want to embed perl in my C code.I work on Visual Studio in Windows.The perl code should do something like this.
- It should ask for user on command line to input 2 xml files and then it should handover the names of these files to my C code which will do post processing on the contents of these files.
- The perl code should also be able to call my C functions based on the number entered on command line by the user.
I have referred the document perlembed.pod and tried to execute the code in section "Maintaining a persistent interpreter" in visual studio C++ environment. But the output is not as expected in the document.The test.pl is never executed.
I will just give a glimpse of what I want to do
#include <EXTERN.h> #include <perl.h> static PerlInterpreter *my_perl = NULL; int _tmain(int argc, _TCHAR* argv[]) { UInt8 char * arg1,*arg2; //Execute some C code over here. // Allocate a perl interpreter memory and then perl code should wai +t on DOS prompt for user to enter the file names and // these file names would be asssigned to arg1 and arg2.Now My C co +de will do processing on contents of these files. // And also I should be able to call some C functions from a perl s +cript code.something like this number = perlgetnumber();// Number pressed by the user. //Call some Functions based on the number. // Deallocate the perl interpretr memory and quit. }Can anybody in the group give me Embedded (C and Perl) code.
It will take a lot of effort to learn and do it.Please guide me.
Thanks in Advance.
Anand
Re "give me Embedded (C and Perl) code" please see http://www.rentacoder.com. This isn't it.
Others have pointed to the Monastery's markup guidelines; you should also see On asking for help and How do I post a question effectively?. Once you have made your own best effort to write the code you seek, post that and the error messages it produces (if any) or a precise description of how it fails to do what you expected. Then, you may expect more specific help.
In reply to Re: Embedding Perl and C
by ww
in thread Embedding Perl and C
by Bhavikatti
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |