cavac has asked for the wisdom of the Perl Monks concerning the following question:

First of all, i have to admit that i feel that i should know this already, but i just don't.

Is it possible to add external cpp/h files when using Inline::CPP? I only need XS bindings for the stuff i'm inlining, the rest only needs to be accesible through the inlined CPP code.

Here is the simplest example i could tink of.
use Inline CPP; for(1..3) { print "Perfect random number: ", cast_die(), "\n"; } __END__ __CPP__ #include "xkcd.h" int cast_die() { int rolled = xkcd_dice_roll(); return rolled; }
#ifndef XKCD_DICE #define XKCD_DICE // See for why this is absolutely perfect #define FAIRLY_GENERATED_RANDOM_NUMBER 4 int xkcd_dice_roll(); #endif
#include "xkcd.h" int xkcd_dice_roll() { return FAIRLY_GENERATED_RANDOM_NUMBER; }

Is something like this even possible with Inline::CPP?

PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP