S
shruti.dabhade
hiii all
I'm tryin to call a perl script from a C program in following 2 ways-
1.By callin system function.
But there's some problem because the system function is not able to
executeany command...it just returns -1.
2.By using the code given in perldoc perlembed(perl documentation for
embedding perl in C)
the code looks like this-
#include <EXTERN.h> /* from the Perl distribution
*/
#include <perl.h> /* from the Perl distribution
*/
static PerlInterpreter *my_perl; /*** The Perl interpreter
***/
int main(int argc, char **argv, char **env)
{
my_perl = perl_alloc();
perl_construct(my_perl);
perl_parse(my_perl, NULL, argc, argv, (char **)NULL);
perl_run(my_perl);
perl_destruct(my_perl);
perl_free(my_perl);
}
now wat happens is that it gives error tht it does not recognise perl.h
and extern.h
copying them to Turbo C's include folder doesn help cos then it
compiles these files also n gives 26 errors!!it is also unable to
locate the header files tht these files use.
Is there any way for me to specify in Turbo C,two paths to look for wen
searching for header files.
in options>directories>include directories i gave a comma n gave path
for perl header files..but it doesn work!!!
Pleeeease help...m at the end of my ideas now!
Thanx in advance.
shruti
I'm tryin to call a perl script from a C program in following 2 ways-
1.By callin system function.
But there's some problem because the system function is not able to
executeany command...it just returns -1.
2.By using the code given in perldoc perlembed(perl documentation for
embedding perl in C)
the code looks like this-
#include <EXTERN.h> /* from the Perl distribution
*/
#include <perl.h> /* from the Perl distribution
*/
static PerlInterpreter *my_perl; /*** The Perl interpreter
***/
int main(int argc, char **argv, char **env)
{
my_perl = perl_alloc();
perl_construct(my_perl);
perl_parse(my_perl, NULL, argc, argv, (char **)NULL);
perl_run(my_perl);
perl_destruct(my_perl);
perl_free(my_perl);
}
now wat happens is that it gives error tht it does not recognise perl.h
and extern.h
copying them to Turbo C's include folder doesn help cos then it
compiles these files also n gives 26 errors!!it is also unable to
locate the header files tht these files use.
Is there any way for me to specify in Turbo C,two paths to look for wen
searching for header files.
in options>directories>include directories i gave a comma n gave path
for perl header files..but it doesn work!!!
Pleeeease help...m at the end of my ideas now!
Thanx in advance.
shruti