lorius has asked for the wisdom of the Perl Monks concerning the following question:
but this does not work (errFnd is filled in case of errors, but errmsg stays empty) I got the impression that there certainly is a better approach for this... thanx !// code contains the perl code (char *) // errmsg should be filled with the compile erros PerlInterpreter *myPerlCompile; /*** The Perl interpreter ***/ char *largv[] = { "", "-c", "-e", code, NULL }; int largc=4; int errFnd; initPerlInterp(); myPerlCompile = perl_alloc(); perl_construct(myPerlCompile); //PL_exit_flags |= PERL_EXIT_DESTRUCT_END; errFnd=perl_parse(myPerlCompile, xs_init, largc, largv, (char **)NULL) +; sprintf(errmsg, "%s", SvPV_nolen(ERRSV));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: embedded perl: check for compile errors without executing
by zentara (Cardinal) on Feb 05, 2010 at 16:57 UTC | |
by lorius (Novice) on Feb 06, 2010 at 10:45 UTC | |
|
Re: embedded perl: check for compile errors without executing
by AriSoft (Sexton) on Feb 08, 2010 at 09:17 UTC | |
by Anonymous Monk on Feb 08, 2010 at 09:39 UTC |