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

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: C++ Code in Perl
by Happy-the-monk (Canon) on Jun 08, 2004 at 14:59 UTC

    How to use C++ snippets in Perl Code.

    What have you tried? There's Inline::Cpp for this, you can easily find it searching this site.

    Cheers, Sören

Re: C++ Code in Perl
by tachyon (Chancellor) on Jun 09, 2004 at 00:18 UTC

    As well as Inline::CPP you can use XS for accessing C++ classes and methods. Here is a useful tutorial. You can use the Inline::CPP makefile which helps make it cross platform. Note that I have found CL.EXE very difficult to work with ie Perl/XS/C++/Win32 however g++ seems to work fine Perl/XS/C++/Linux. See C++ and XS compile issues on Win32. Your C++ header files need to appear first in your XS or XS gets confused about the language and tries to compile C++ code as C. If there is an option perl and C fit hand in glove. Perl and C++ is a bit more iffy.

    cheers

    tachyon

Re: C++ Code in Perl
by Anonymous Monk on Jun 08, 2004 at 19:58 UTC