in reply to Re^5: Wperl.exe fails with Tk + piped process ( Win32 )
in thread Wperl.exe fails with Tk + piped process ( Win32 )

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.

Replies are listed 'Best First'.
Re^7: Wperl.exe fails with Tk + piped process ( Win32 )
by Anonymous Monk on Jan 10, 2012 at 13:30 UTC
    Or you could  wperl fudge.pl
    my $perl = $^X; $perl =~ s/wperl.exe/perl.exe/i; use Win32 qw(SW_HIDE); Win32::SetChildShowWindow(SW_HIDE); system(1, $perl, '-le', 'warn(666);close STDOUT;use Win32;Win32::MsgBo +x(0);' );