source: trunk/essentials/app-shells/bash/examples/loadables/perl/iperl.c@ 3506

Last change on this file since 3506 was 3228, checked in by bird, 19 years ago

bash 3.1

File size: 551 bytes
Line 
1#include <EXTERN.h> /* from the Perl distribution */
2#include <perl.h> /* from the Perl distribution */
3
4extern void xs_init _((void));
5
6static PerlInterpreter *iperl; /*** The Perl interpreter ***/
7
8int
9perl_main(int argc, char **argv, char **env)
10{
11 int r;
12
13 iperl = perl_alloc();
14 perl_construct(iperl);
15 perl_parse(iperl, xs_init, argc, argv, (char **)NULL);
16 r = perl_run(iperl);
17
18PerlIO_flush(PerlIO_stdout());
19PerlIO_flush(PerlIO_stderr());
20
21 perl_destruct(iperl);
22 perl_free(iperl);
23 return (r);
24}
Note: See TracBrowser for help on using the repository browser.