Our company obtained a C++ source code license for Metaphone3 and I want to test it using Perl as a driver. I'm wondering what my options are. In the past, when I needed to call a complex C subroutine from Perl, I've written a standalone C++ program that accepted command-line parameters, called the subroutine, and wrote the output to STDOUT, and then "called" it using qx//. That's certainly still a possibility, but on the offchance that the forking and IPC would pose a performance hit (I'm going to test 100M's of strings), I wondered if XS was a practical possibility.
I have never written an XS module, and it looks daunting, but I thought there might be some XS stub code out there that I could easily tweak so that a Perl program could call one subroutine, passing in one string and getting two strings back; end of story.
Any thoughts on the subject? Other approaches?
(Metaphone3 is also available in Perl, but unfortunately that's a separate license.)
In reply to Calling a C++ subroutine from Perl by ibm1620
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |