init version.
[bush.git] / examples / loadables / perl / iperl.c
blob92a60387d8d928e894af987c12ab380b7e9e120a
1 #include <EXTERN.h> /* from the Perl distribution */
2 #include <perl.h> /* from the Perl distribution */
4 extern void xs_init _((void));
6 static PerlInterpreter *iperl; /*** The Perl interpreter ***/
8 int
9 perl_main(int argc, char **argv, char **env)
11 int r;
13 iperl = perl_alloc();
14 perl_construct(iperl);
15 perl_parse(iperl, xs_init, argc, argv, (char **)NULL);
16 r = perl_run(iperl);
18 PerlIO_flush(PerlIO_stdout());
19 PerlIO_flush(PerlIO_stderr());
21 perl_destruct(iperl);
22 perl_free(iperl);
23 return (r);