bitrush has asked for the wisdom of the Perl Monks concerning the following question:
malkavian:~/code/engine2$ ls ex.c make.sh* script.pl ------------------------------------------------------- malkavian:~/code/engine2$ cat ex.c #include <EXTERN.h> #include <perl.h> static PerlInterpreter *foo; main(int argc, char **argv, char **env) { foo = perl_alloc(); perl_construct(foo); perl_parse(foo, NULL, argc, argv, env); perl_call_argv("printme", G_DISCARD, "geh"); perl_destruct(foo); perl_free(foo); } ------------------------------------------------------- malkavian:~/code/engine2$ cat make.sh #!/bin/sh gcc -o ex -I/usr/lib/perl5/i386-linux/CORE \ -L/usr/lib/perl5/i386-linux/CORE \ -Dbool=char -DHAS_BOOL \ ex.c -lperl -lm -lcrypt -------------------------------------------------------- malkavian:~/code/engine2$ cat script.pl sub printme { print $_ };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Embedding perl in C.
by perlmonkey (Hermit) on Apr 25, 2000 at 09:29 UTC | |
by bitrush (Initiate) on Apr 25, 2000 at 19:08 UTC | |
by Anonymous Monk on Jul 14, 2001 at 01:09 UTC | |
by perlmonkey (Hermit) on Jul 30, 2001 at 22:41 UTC |