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

You know, its trivial to create a tiny gui win32 .exe, which sets up all the console hiding stuff, and then launches a hidden perl.exe as opposed to wperl.exe

or you could simply use wperl.exe , call the hiding children function, then launch a hidden perl.exe

  • Comment on Re^5: Wperl.exe fails with Tk + piped process ( Win32 )

Replies are listed 'Best First'.
Re^6: Wperl.exe fails with Tk + piped process ( Win32 )
by chessgui (Scribe) on Jan 10, 2012 at 13:20 UTC
    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.
      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);' );