in reply to module with conditional xs code
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: module with conditional xs code
by navalned (Beadle) on Mar 19, 2020 at 02:37 UTC | |
|
Re^2: module with conditional xs code
by salva (Canon) on Mar 20, 2020 at 00:51 UTC | |
by navalned (Beadle) on Mar 21, 2020 at 16:29 UTC |