You're right that if it's possible to solve the problem without using Mathematica, XS / Inline::C library wrapping, it is better to try what's available. However, I figured that I would put it out there, so that OP would know that there are other options if the problem gets complex enough.
I'm a big fan of Perl, but to be honest, not every problem is right for it. If the OP can get a more elegant solution by using a technical computing platform like Matlab, or Mathematica (and if they can afford to), he or she may want to. However, if the OP has a reason to use Perl -- perhaps to interface with a CGI script or already existing Tk/Perl application? -- the option is there.
I would also like to point out, that the OP doesn't have to use XS to return the values. If the solution is significantly complex, or the number is to a precision bigger then you can return via XS, or there is another reason to make XS a bad solution, it is possible to send the result over a Unix domain socket or a TCP/IP connection, or through a database, or put it in a file, or any of a number of possible solutions. Sometimes the best way to use a program is via a system() call that invokes a program that sends the data back to the program via a Unix domain socket. Of course, you're still going to have to roll your own protocol, but I figured I would put it out there so that the OP can decide what is best for his/her needs.
Want to support the EFF and FSF by buying cool stuff? Click here.
| [reply] [d/l] |