in reply to Re: launch a program and then write to the program
in thread launch a program and then write to the program

hi, Thanks for the code. I tried opening a pipe to the R.exe program, and then attempted to write to it using: my $program = "C:\\Program\ Files\\R\\R-2.7.1\\bin\\R.exe"; open my $x, "|-", "$program" or die "Can't launch R: $!"; $your_data="hello"; print $x $your_data; I obtained an error: Fatal error: you must specify '--save', '--no-save' or '--vanilla' I also tried the above code replacing the R.exe with the Rgui.exe. Although I didn't receive an error, I didn't obtain the output to the Rgui window. Further, using this option, perl doesn't continue past the point where the program is called (this is probably why I receive no error). I would like to be able to call the program, send some commands to it, obtain its output and then terminate the program. Could you please suggest where I can modify my code to make this work? Thanks! Al
  • Comment on Re^2: launch a program and then write to the program

Replies are listed 'Best First'.
Re^3: launch a program and then write to the program
by moritz (Cardinal) on Jul 15, 2008 at 22:27 UTC
    I obtained an error: Fatal error: you must specify '--save', '--no-save' or '--vanilla'

    So did you specify any of these options to R.exe? what was the result?

    First learn how to use your programs from the command line, and when you got that try to automate that with perl.