|
|
| Do you know where your variables are? | |
| PerlMonks |
Re: Best way to implement Inline::C/Pure Perl function in a module?by syphilis (Canon) |
| on Oct 26, 2012 at 00:06 UTC ( #1000973=note: print w/ replies, xml ) | Need Help?? |
|
I think I would do it thusly: If Inline::C is not available, that uses the pure-perl implementation of foo() and outputs: Otherwise, it uses the the Inline::C implementation of foo() and outputs: NOTE: Running that script with Inline support will also output the C compilation report - but only for the *first* running, of course. Note also that those who have Inline::C can still access the pure-perl implementation of foo() if they wish, by directly calling bar(). Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||