You could look at match::simple and match::simple::XS.
The way it works is match::simple::XS provides a function called match. Users load match::simple. When match::simple is first loaded, it attempts to load match::simple::XS and import the match function. If it fails, it does a stringy eval on a pure Perl implementation of match. It exports match to the user.
End users just do use match::simple; if they have match::simple::XS installed, they get the XS implementation automatically.
In reply to Re: module with conditional xs code
by tobyink
in thread module with conditional xs code
by navalned
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |