Oh Lord, if you are new to Perl. you don't want to look at XS (I'm not new to Perl, and I don't want to look at XS). See Inline :: C or Inline :: CPP for a much softer introduction to C and C ++ calls from Perl. Deeper drilling in the XS interface should only be necessary if you want to start transferring or retrieving complex data structures (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);
source
share