Using Perl with compiled C library?

apache, c++, perl

Solution

Oh Lord, if you are new to Perl. you do not want to be looking at XS (I am not new to Perl and I do not want to look at XS). See Inline::C or Inline::CPP for a much gentler introduction to calling C and C++ from Perl. Drilling deeper into the XS interface should only be necessary if you want to start passing or returning complicated data structures around (and maybe not even then).

use Inline C => Config => LIBS => '-L/<yourlibpath> -l<yourlib>';

$x = my_library_function_that_returns_an_int_or_double($integer_arg,$string_arg);

Problem

I would like to try and use Perl, but need to communicate with another application I wrote. I have an interface library that I wrote in C++, and it contains the socket communications and interface protocol to set/get parameters in my application. I would like to use Perl with Apache to serve up web pages for configuring my application. I need to know how to get Perl to talk to my interface library.

Original source

Related problems