It works! You only have to take care to create the Win32::Process object with creation flag: CREATE_NO_WINDOW.
I copy the code should anyone need it.
So, run this script via wperl.exe from the working directory of the main script (let's say that the path to perl.exe is 'c:\strawberry\perl\bin' and the main script is called 'gui.pl'):
use Win32::Process;
Win32::Process::Create($perl,'c:\strawberry\perl\bin\perl.exe','perl.e
+xe gui.pl',0,CREATE_NO_WINDOW,'.');
In the main script include:
use Win32 qw(SW_HIDE);
Win32::SetChildShowWindow(SW_HIDE);
In this framework no console window is opened and the Open2 call is safe. |