On Jan 17, 2016 11:47 AM, "David Oswald" <daosw...@gmail.com> wrote:
>
> Have a look at the source (including Makefile.PL) of Math::Random::ISAAC,
List::Binary::Search, and Bytes::Random::Secure for ideas of how. Also
JSON, and Text::CSV.
>
> Most or all of the above load a Pure Perl module in the absence of an XS
alternative or the XS version if available.
>

I have a potentially corner-ish case here, as the API is (ever so slightly)
different between the two modules — the PP version has an OO interface that
the XS lacks.

Since the OO methods are just thin wrappers around the procedural interface
(which matches the XS interface verbatim), I'm thinking I might want to do
some symbol table trickery: rename the PP procedural subs (underscore
prefix or something), then in a BEGIN block try to require the XS module,
and either way install "correctly" named globs into %{__PACKAGE__ . '::'}.

I suspect the API of the XS module won't change, but I don't know, and I
don't like not knowing. Hence, I want to get the nod from GONZUS before I
go for it.

--
Paul W Bennett

Reply via email to