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

Hello Monks, I have a C++ application whose members functions need to be called from Perl and also its member variables need to be updated from Perl. Can you suggest the simplest ways to do this, as I am fairly new to Perl.

Replies are listed 'Best First'.
Re: Perl and C++ interface
by shmem (Chancellor) on Oct 26, 2015 at 06:15 UTC

    If your application is a separate process, you need some kind of IPC (shared memory, pipes or such - see perlipc). Perl can interface libraries via XS (see perlxs and perlxstut), but not a separate address space.

    If you want to use perl from within that application, you need an embedded perl (see perlembed).

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
      Can Win32::OLE be used for interfacing?
        Depends on your C++ application :/
        first of all is it a C++ application or library?
        if it is a library,does it expose an Automation interface? (IDispatch)