I'm trying to make an .exe from a simple perl script that uses the Statistics::R package.
use Statistics::R;
use strict;
my $R = Statistics::R->new();
$R->startR;
$R->send('x=10');
$R->send('x');
my $ret = $R->read;
print $ret;
$R->stopR();
Everything works fine until I create the perlapp .exe file. When I test this, I get the following errors:
Inappropriate I/O control operation: Win32::Process::Create() at /<C:\@programming\r\trying_r_bridge.exe>IPC/Run.pm line 2105
Inappropriate I/O control operation: Win32::Process::Create() at /<C:\@programming\r\trying_r_bridge.exe>IPC/Run.pm line 2224
Inappropriate I/O control operation: Win32::Process::Create() at /<C:\@programming\r\trying_r_bridge.exe>IPC/Run.pm line 2224
I looked online and found this thread about the problem: http://www.nntp.perl.org/group/perl.par/2011/05/msg5022.html
This is what they say:
this happens because the IPC::Run module on Win32 (only) tries to run subprocesses using $^X, which normally contains the path to perl.exe. However, when PAR packs an executable, $^X doesn't happen to point to perl.exe, and so IPC::Run fails at that point. Implementing IPC::Run on Windows without using subprocesses is an unsolved problem.
In the end, the thread solution is to use IPC::Run3, which is not an option here.
Any suggestions for how to overcome this problem?