in reply to SWIG or Inline::CPP
Inline::CPP lets you write Perl subroutines and classes in C++. You
don't have to learn XS or SWIG, you can just put code right "inline"
in your source.
use Inline CPP => <<'END'; class JAxH { public: JAxH(char *x); SV* data(); private: SV *dat; }; JAxH::JAxH(char *x) { dat = newSVpvf("Just Another %s Hacker", x); +} SV* JAxH::data() { return dat; } END print JAxH->new('Inline')->data(), "\n"; When run, this complete program prints: Just Another Inline Hacker.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: SWIG or Inline::CPP
by Anonymous Monk on Dec 06, 2005 at 09:05 UTC | |
by maxpacer (Novice) on Mar 09, 2006 at 02:44 UTC |