集成进来的话,大概是这样
例子:
#include/* from the Perl distribution */
#include/* from the Perl distribution */
static PerlInterpreter *my_perl; /*** The Perl interpreter ***/
int main(int argc, char **argv, char **env)
{
PERL_SYS_INIT3(&argc,&argv,&env);
my_perl = perl_alloc();
perl_construct(my_perl);
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_parse(my_perl, NULL, argc, argv, (char **)NULL);
perl_run(my_perl);
perl_destruct(my_perl);
perl_free(my_perl);
PERL_SYS_TERM();
}
详见
http://perldoc.perl.org/perlembed.html#Adding-a-Perl-interpreter-to-your-C-program
可以用system调用来执行脚本,如果不需要交互的话