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

Hello, How do I query the Perl version from C code with perl embedded in C program? It needs to be a runtime check since the perl shared library is selected at runtime. Thanks. -William

Replies are listed 'Best First'.
Re: Query Perl embedded version from C?
by esskar (Deacon) on Jan 17, 2006 at 03:38 UTC
    Perl.h says the following
    #define PERL_XS_APIVERSION "5.8.3"
    #define PERL_PM_APIVERSION "5.005"
    
      perl.h also says this:
      /* Source code compatibility cruft: PERL_XS_APIVERSION is not used, and has been superseded by inc_vers +ion_list It and PERL_PM_APIVERSION are retained for source compatibility in +the 5.8.x maintenance branch. */

      Dave.

Re: Query Perl embedded version from C?
by Anonymous Monk on Jan 17, 2006 at 02:50 UTC
    $]