________________________________ > Date: Mon, 11 Aug 2014 05:48:22 -0700 > From: glasswal...@yahoo.com.br > Subject: Re: How do you handle a perl process that never seems to exit? > To: cpan-testers-discuss@perl.org > > Hello there, > > I found this part interesting in the code: > > 1537 if ($is_mswin || $is_vms) { > 1538 # On Windows, try to get the 'real' PID > 1539 if ($is_mswin) { > 1540 eval { require Win32; }; > 1541 if (defined(&Win32::GetCurrentProcessId)) { > 1542 $pid_to_kill = Win32::GetCurrentProcessId(); > 1543 } > 1544 } > > If it tries to load specific platform code, why not try to use the > Win32 API to take care of creating and removing a process (see > Win32::Process)? >
Win32::Process doesnt support specifying the handles to use, so redirecting std handles is impossible using Win32::Process. The C Win32 CreateProcess takes file handles to use for std handles.