[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mod_octave?
From: |
Andy Adler |
Subject: |
Re: mod_octave? |
Date: |
Wed, 19 Mar 2003 22:37:25 -0500 (EST) |
On Wed, 19 Mar 2003, Gavin Jin wrote:
> If not a stand alone mod_octave, how about something that works with
> mod_* and frees the web server from loading the octave interpreter
> every time a new octave task needs to be evaluated?
>
> Can any of the suggestions you mentioned do that?
The following works well with apache cgi-bin.
I don't see any reason why it wouldn't work well with mod_perl:
If you try this solution, keep us posted on the results.
-----File C:/Apache/cgi-bin/inlinetest.cgi
#!c:/cygwin/bin/perl.exe
print "Content-type: text/plain\n\n";
printf "Test Perl: 2+2 = %d\n", perl_add(2,2);
printf "Test C: 2+2 = %d\n", c_add(2,2);
printf "Test Octave: 2+2 = %d\n", octave_add(2,2)->as_scalar();
sub perl_add {
my ($a,$b)= @_;
return $a+$b;
}
use Inline C => q{
int c_add ( int a, int b) {
return a+b;
} };
use Inline Octave => q{
function s=octave_add(a,b);
s= a+b;
endfunction };
-----------------------------------
Web server output is:
Test Perl: 2+2 = 4
Test C: 2+2 = 4
Test Octave: 2+2 = 4
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
Re: mod_octave?, Paul Kienzle, 2003/03/19