Thank yu Tassilo and David for your insights!!
>
>
> Maybe I can also point you to [EMAIL PROTECTED] If you want
> to do the occasional XS or embedding, this mailing-list is
> the right place to consult.
I may do that, thanks!
Ok heres what
#include <EXTERN.h>
#include <perl.h>
static PerlInterpreter *my_perl;
main (int argc, char **argv, char **env)
{
const char *perlcode = "use CGI 'header'; print header();print 'hello World';";
my_perl = perl_alloc();
perl_construct( my_perl );
perl_parse(my_perl, NULL, argc, argv, (char **)NULL);
perl_run(my_perl); /* this line will execute cmd line perl */
printf(perlcode); /* this line successfully prints the Perl code above out */
/* Leave the comments below in place and it compiles fine, uncomment them and you get
the results I've put below each one */
/* From Tassilo
STRLEN n_a;
SV *res = eval_pv(perlcode);
printf("%s", SvPV(res, n_a));
at compile:
cc -o perlemb perlemb.c `perl -MExtUtils::Embed -e ccopts -e ldopts`
perlemb.c: In function `main':
perlemb.c:19: syntax error before `n_a'
perlemb.c:21: `res' undeclared (first use in this function)
perlemb.c:21: (Each undeclared identifier is reported only once
perlemb.c:21: for each function it appears in.)
perlemb.c:21: `n_a' undeclared (first use in this function)
*/
/* From David
printf("%s",SvPV_nolen(eval_pv(perlcode,0)));
at compile:
cc -o perlemb perlemb.c `perl -MExtUtils::Embed -e ccopts -e ldopts`
/tmp/ccTi5bTD.o: In function `main':
/tmp/ccTi5bTD.o(.text+0x77): undefined reference to `eval_pv'
/tmp/ccTi5bTD.o(.text+0x82): undefined reference to `SvPV_nolen' */
perl_destruct(my_perl);
perl_free(my_perl);
}
Any ideas what I need to do to resolve those errors? (Besdies going elsewhere ;p )
TIA
Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]