Eliminate use of $& to avoid runtime penalty
[p5sagit/p5-mst-13.2.git] / miniperlmain.c
CommitLineData
a0d0e21e 1/*
2 * "The Road goes ever on and on, down from the door where it began."
3 */
4
4633a7c4 5#ifdef __cplusplus
6extern "C" {
7#endif
8
ecfc5424 9#include "EXTERN.h"
2304df62 10#include "perl.h"
11
4633a7c4 12#ifdef __cplusplus
13}
14# define EXTERN_C extern "C"
15#else
16# define EXTERN_C extern
17#endif
18
a0d0e21e 19static void xs_init _((void));
20static PerlInterpreter *my_perl;
21
c07a80fd 22int
dc6439a4 23#ifdef CAN_PROTOTYPE
24main(int argc, char **argv, char **env)
25#else
2304df62 26main(argc, argv, env)
27int argc;
28char **argv;
29char **env;
dc6439a4 30#endif
2304df62 31{
32 int exitstatus;
2304df62 33
c07a80fd 34 PERL_SYS_INIT(&argc,&argv);
4633a7c4 35
c07a80fd 36 perl_init_i18nl14n(1);
4633a7c4 37
a0d0e21e 38 if (!do_undump) {
39 my_perl = perl_alloc();
40 if (!my_perl)
41 exit(1);
42 perl_construct( my_perl );
43 }
2304df62 44
28e44ed9 45 exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL );
2304df62 46 if (exitstatus)
47 exit( exitstatus );
48
49 exitstatus = perl_run( my_perl );
50
748a9306 51 perl_destruct( my_perl );
2304df62 52 perl_free( my_perl );
53
a91be337 54 PERL_SYS_TERM();
55
2304df62 56 exit( exitstatus );
57}
58
59/* Register any extra external extensions */
60
4633a7c4 61/* Do not delete this line--writemain depends on it */
62
a0d0e21e 63static void
64xs_init()
2304df62 65{
a91be337 66 dXSUB_SYS;
2304df62 67}