in reply to XS: exposing C++ library constant as package variable

Have you considered using h2ph to generate Perl constants directly from the .h files?

Or, since it's a few specific constants, you could write your own Perl script to extract just those constants and generate Perl constants from them. (Might want to look at constant.pm if you do write your own extractor.)

I think Perl constants have less access overhead and you'd only have to run the extractor when building the XS library module.

Replies are listed 'Best First'.
Re^2: XS: exposing C++ library constant as package variable
by Anonymous Monk on Oct 07, 2015 at 22:44 UTC
    Why make more work when you don't have to?