#include "mlp_perl.h" /* TODO: Error checking... */ mlp_perl_runtime::mlp_perl_runtime(mlp_context *ctx, mlp_language *lang, const void *opts) : mlp_runtime(ctx, lang, opts), my_perl(NULL){ ctx->clear_error() ; my_perl = perl_alloc() ; perl_construct(my_perl) ; char *embedding[] = { "", "-e", "0" } ; perl_parse(my_perl, NULL, 3, embedding, NULL) ; PL_exit_flags |= PERL_EXIT_DESTRUCT_END ; perl_run(my_perl) ; } mlp_perl_runtime::~mlp_perl_runtime(){ if (my_perl != NULL){ perl_destruct(my_perl); perl_free(my_perl); } } PerlInterpreter *mlp_perl_runtime::_get_my_perl(){ return my_perl ; } void mlp_perl_runtime::destroy(mlp_context *ctx){ ctx->clear_error() ; mlp_runtime::destroy(ctx) ; } mlp_library *mlp_perl_runtime::load_library(mlp_context *ctx, const char *name, const void *opts){ ctx->clear_error() ; return new mlp_perl_library(ctx, this, name, opts) ; } void mlp_perl_runtime::setup_context(mlp_context *ctx){ ctx->clear_error() ; }