#!/usr/bin/perl use strict; use warnings; use Config; use Inline C => Config => BUILD_NOISY => 1, CCFLAGS => $Config{ccflags}." -DDEBUG=1"; use Inline C => <<'END_C', NAME => 'Example', CLEAN_AFTER_BUILD =>0; static PerlInterpreter *my_perl; int main(int argc, char **argv) { char* command_line[] = {"", "-e", "print \"Hello from C!\\n\";"}; my_perl = perl_alloc(); perl_construct(my_perl); perl_parse(my_perl, NULL, 3, command_line, (char **)NULL); perl_run(my_perl); perl_destruct(my_perl); perl_free(my_perl); return 0; } int add( int a, int b ) { int result; result = a + b; return result; } int hello() { printf("Hello World\n"); } END_C sub message { print "Everything went well" } &message;