MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica from Perl

  • To: mathgroup at
  • Subject: [mg29274] Re: [mg29242] Mathematica from Perl
  • From: Omega Consulting <pptssman at>
  • Date: Sat, 9 Jun 2001 03:09:02 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Mathematica notebooks are primarily for use with the front end. You would 
be much better off trying to interface with the kernel. The best way to do 
this is to convert your notebook into a package (File>Save As 
Special>Package Format).

Once you do this, you can communicate with the kernel in several ways. You 
can use perl commands to execute the kernel just like you would from the 
command line. Such as

exec("math << mypackage.m >> myresults.txt")

This executes the kernel with input coming from your package and output 
going to a text file (assuming that you or the perl script needs to look at 
the output). You can also have the package write output to a file with 
kernel commands. This gives you more control over the output.

An alternative is to use MathLink to communicate between perl and 
Mathematica. See

At 12:14 AM 6/7/2001, Zoltan Garamvolgyi wrote:
>Hello Everybody,
>How can I run a Mathematica notebook form perl script?
>How can I read the commandline's argument in mathematica?
>Thank you for your help,
>Zoltan Garamvolgyi
>Get Your Private, Free E-mail from MSN Hotmail at

  • Prev by Date: Re: Replacing 1 to many in a list
  • Next by Date: Re: Replacing 1 to many in a list
  • Previous by thread: Mathematica from Perl
  • Next by thread: Reverse the vertical axis