Skip to content
Perl Module: Inline::CPP: Include C++ code inline within Perl code.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
inc/ILCPPConfig just use EU::CppG, not roll own Mar 25, 2019
lib/Inline Version bump to v0.80 to require Inline::C version 0.80 for better ba… Apr 19, 2019
t fix for abstract class - fix #49 Mar 29, 2019
xt zap now-broken Test::CheckManifest Mar 24, 2019
.perltidyrc Add a .perltidyrc to our repo. Aug 12, 2014
.travis.yml support perl 5.8.1 since Pegex does again Mar 29, 2019
LICENSE Shift from Artistic 1 to Artistic 2 (Approved D.O / N.W.) to clear a … Aug 21, 2014
META.yml Prepare version 0.79 for release. Apr 2, 2019
Makefile.PL Version bump to v0.80 to require Inline::C version 0.80 for better ba… Apr 19, 2019
README Version bump to v0.80 to require Inline::C version 0.80 for better ba… Apr 19, 2019



Inline::CPP -- Write Perl subroutines and classes in C++.

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 {
       JAxH(char *x);

       SV* data();
       SV *dat;

   JAxH::JAxH(char *x) { dat = newSVpvf("Just Another %s Hacker", x); }
   SV* JAxH::data() { return dat; }


   print JAxH->new('Inline')->data(), "\n";

When run, this complete program prints:

   Just Another Inline Hacker.


It should go without saying, but you will need a C++ compiler on your system.
The C++ compiler should be of the same flavor as the C compiler used to build
perl itself.  If you're using GNU C++, be sure that you have the g++ front
end installed (it isn't installed by default on some Linux distros, for
example).  If you cannot execute 'g++ -v' from the command prompt, or some
variation for your specific C++ compiler,


If you have the HARNESS_OPTIONS environment variable set to run tests
concurrently in multiple processes, the test suite will attempt to invoke
the C++ compiler multiple times concurrently.  Recent versions of Inline and
Inline::C have made progress on stamping out race conditions, but YMMV for now.

Also, some smoke testers run their testing in parallel, which may also be
problematic, and may result in FAIL reports for reasons that will never
occur in the real world.

See Makefile.PL, or the META.* files for lists of dependencies and minimum
dependency version numbers.  Minimum Perl version is now 5.8.1, same as Inline.

To install Inline::CPP do this:

perl Makefile.PL
make test
make install

(On ActivePerl for MSWin32, use nmake instead of make.)
(On Strawberry Perl you may use dmake instead.)

As Makefile.PL runs you will be prompted for what C++ compiler and library to
use.  Accepting the default should work in nearly every case (and if it
doesn't, let me know).


- For more information on Inline::CPP see 'perldoc Inline::CPP'.
- For information about, see 'perldoc Inline'.
- For information about Inline::C (of which this is a subclass)
  see 'perldoc Inline::C', as well as 'perldoc Inline::C-Cookbook'.
- For information on using Perl with C or C++, see 'perldoc perlapi'

The Inline mailing list is Send mail to to subscribe.

This module's development is under version control with Git, hosted on Github

Please send questions and comments to "David Oswald" <>

Copyright (c) 2003 - 2014, Neil Watkiss, David Oswald. All Rights Reserved.
You can’t perform that action at this time.