Re: Execute an external script

2004-03-03 Thread p . libardi
I managed to solve the problem. Thanks a lot to everyone, starting from
part of any of your help I've been able to find the solution. My .m files
where just associated to Octave, the problem was due to taint constraint
I do always use for Perl scripts.

I had to add

$ENV{'PATH'}='C:/Program Files/GNU Octave 2.1.50/bin/';

just before the use strict; instruction, and in my function now I can do:

my $output = `octave.exe -q my_script.m`;

where my_script.m is in cgi-bin directory.
Now I've to try using .m files in other directory, but I've got the solution.

Thanks again.
Paolo

__
Tiscali ADSL SENZA CANONE:
Attivazione GRATIS, contributo adesione GRATIS, modem GRATIS,
50 ore di navigazione GRATIS.  ABBONARTI TI COSTA SOLO UN CLICK!
http://point.tiscali.it/adsl/index.shtml




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Execute an external script

2004-03-03 Thread Charlie somerville
Well, it returns null because when you try to escape in that string, that's
perls escape that your using, not XP's excape.
A way around this might be (i dunno, never tried this before):

system("cd C:/Program Files/GNU/Octave/2.1.50/");
$result= `bin -q my_script.m`;

If that doesn't work then setup windows to have files with .m on the end be
run by 'C:\Program Files\GNU\Octave\2.1.50\bin'.
Here is how:

Goto 'My Computer'
Click 'Tools'
Click 'Folder options'
A dialog shoudl come up, click the 'File types' tab.
When the list of registered file extensions finishes loading, click 'New'
Type 'm' in the box then hit 'enter'
The new file extension should be at the top of the list selected, if it
isn't, just select it.
Click 'advanced'
a dialog shoudl open.
in the first box type 'Octave script'
click 'new'
type 'open' in the first box of the new dialog
in the second dialog, type (yes type the double-quotes, but not thhe signle
ones) ' "C:\Program Files\GNU\Octave\2.1.50\bin -q" %1 '
click 'ok'
click 'ok' again
click 'ok' again again!
Done.

Pinchy

Charlie

PS: Reckon this is pretty good for a 9 year old?

"P Libardi" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi! I've written a perl cgi script to create a web page. Now what I'd like
to do is to execute an Octave script from the Perl one and get its output
inside my perl script. I'm working on a Windows XP machine.
I tried $result = `C:/Program\ Files/GNU\ Octave\ 2.1.50/bin -q
my_script.m`;
but $result is still null. The octave script runs correctly if I use it
in the Gnu Octave shell.
Any help would be really appreciated.
Paolo

__
Tiscali ADSL SENZA CANONE:
Attivazione GRATIS, contributo adesione GRATIS, modem GRATIS,
50 ore di navigazione GRATIS.  ABBONARTI TI COSTA SOLO UN CLICK!
http://point.tiscali.it/adsl/index.shtml





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Execute an external script

2004-03-03 Thread p . libardi
>> I tried $result = `C:/Program\ Files/GNU\ Octave\ 2.1.50/bin -q
>> my_script.m`; but $result is still null.

sorry, in copy and paste I forgot a part of the instruction. The instruction
I'm using is:
my $output = `"C:/Program\ Files/GNU\ Octave\ 2.1.50/bin/octave.exe  -q
my_script.m"`;

The error I've is:

'C:/Program' is not recognized as an internal or external command, operable
program or batch file.

I tried to exec a my_script.bat file located in the same directory of octave.exe,
just with "echo hello!", and that run fine.

I cannot use system("") as I'm working with strict and taint parameters,
and this instruction is forbidden.

Thanks for any hint.
Paolo


__
Tiscali ADSL SENZA CANONE:
Attivazione GRATIS, contributo adesione GRATIS, modem GRATIS,
50 ore di navigazione GRATIS.  ABBONARTI TI COSTA SOLO UN CLICK!
http://point.tiscali.it/adsl/index.shtml




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Execute an external script

2004-03-02 Thread zsdc
[EMAIL PROTECTED] wrote:

Hi! I've written a perl cgi script to create a web page. Now what I'd like
to do is to execute an Octave script from the Perl one and get its output
inside my perl script. I'm working on a Windows XP machine.
I tried $result = `C:/Program\ Files/GNU\ Octave\ 2.1.50/bin -q my_script.m`;
but $result is still null. The octave script runs correctly if I use it
in the Gnu Octave shell.
Any help would be really appreciated.
Try running that external program with:

  system 'command to run' and die $!;

or:

  $result = `command to run` or die $!;

and see what it says. Watch out for whitespace.
--
ZSDC
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: Execute an external script

2004-03-02 Thread Bob Showalter
[EMAIL PROTECTED] wrote:
> Hi! I've written a perl cgi script to create a web page. Now what I'd
> like to do is to execute an Octave script from the Perl one and get
> its output inside my perl script. I'm working on a Windows XP machine.
> I tried $result = `C:/Program\ Files/GNU\ Octave\ 2.1.50/bin -q
> my_script.m`; but $result is still null.

Is "bin" really the name of the execuatble, or is it a directory name?
Something seems to be missing.

Also, those backslashes aren't doing anything for you, AFAIK.

You might want to write that as:

   `"C:/Program Files/GNU/Octave 2.1.50/bin/" -q my_script.m`

program name here

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Execute an external script

2004-03-02 Thread p . libardi
Hi! I've written a perl cgi script to create a web page. Now what I'd like
to do is to execute an Octave script from the Perl one and get its output
inside my perl script. I'm working on a Windows XP machine.
I tried $result = `C:/Program\ Files/GNU\ Octave\ 2.1.50/bin -q my_script.m`;
but $result is still null. The octave script runs correctly if I use it
in the Gnu Octave shell.
Any help would be really appreciated.
Paolo

__
Tiscali ADSL SENZA CANONE:
Attivazione GRATIS, contributo adesione GRATIS, modem GRATIS,
50 ore di navigazione GRATIS.  ABBONARTI TI COSTA SOLO UN CLICK!
http://point.tiscali.it/adsl/index.shtml




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]