Zrobiłem skrypt .cgi który używa do obliczeń octave. Problem jest taki, iż po podaniu do skryptu wektora np: A =[3 4 4]. otrzymuje wynik w postaci:
Chciałbym żeby tekst "powitalny" octave był w jednej zmiennej, a wektor A w innej. W moim skrypcie .cgi zawarłem taki kod służący do parsowania, niestety nie działa:GNU Octave, version 3.0.1 Copyright (C) 2008 John W. Eaton and others. This is free software; see the source code for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'. Octave was configured for "i486-pc-linux-gnu". Additional information about Octave is available at http://www.octave.org. Please contribute if you find this software useful. For more information, visit http://www.octave.org/help-wanted.html Report bugs to (but first, please read http://www.octave.org/bugs.html to learn how to write a helpful report). For information about changes from previous versions, type `news'. A = 3 4 4
Kod: Zaznacz cały
@tekst = system("octave plik");
foreach $tekst (@tekst)
{
($witaj, $wartosc) = split(/`news'./, $tekst);
}
print "$witaj";
print "$wartosc";