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

I'm working on a parser, and it's necessary for me to allow for "variants". By this I mean things like: implemented with XS, or without; targeting Perl 5, or C, or Parrot, etc., etc.

The most obvious way of doing this is via the CPAN namespace, in which case I'd wonder which naming schemes seem to be Best Practice. Or is there another way to go?

I'm sure a number of CPAN modules already are present in multiple variants (certainly XS versus non-XS for environments without compilers), and I could just look around, but I'm not sure how to tell the ones whose "variant" schemes are tolerated for historical reasons, from those which represent the latest wisdom on this matter.

thanks, jeffrey kegler

Replies are listed 'Best First'.
Re: How to implement CPAN module variants
by dragonchild (Archbishop) on Sep 29, 2007 at 01:55 UTC
    Scalar::Util is a good example of a module with an XS and PurePerl implementation.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Re: How to implement CPAN module variants
by perlfan (Parson) on Sep 29, 2007 at 14:12 UTC
Re: How to implement CPAN module variants
by Jeffrey Kegler (Hermit) on Sep 30, 2007 at 22:57 UTC
    I'll bear both alternatives in mind when the time comes. In my early guessing, the Scalar::Util example seems better, because it hides the issue of XS or not to XS from the user.

    many thanks, jeffrey kegler