in reply to Re^5: Running a perl script as a system command in another thread hangs while main thread reading from STDIN
in thread Running a perl script as a system command in another thread hangs while main thread reading from STDIN

I included that in my first reply to you, but I will add it in to my original post for clarity. Both 2012 systems are using active state perl 5.18.2
C:\>perl -v This is perl 5, version 18, subversion 2 (v5.18.2) built for MSWin32-x +64-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2013, Larry Wall Binary build 1801 [297964] provided by ActiveState http://www.ActiveSt +ate.com Built Feb 24 2014 11:06:47 Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge.
  • Comment on Re^6: Running a perl script as a system command in another thread hangs while main thread reading from STDIN
  • Download Code

Replies are listed 'Best First'.
Re^7: Running a perl script as a system command in another thread hangs while main thread reading from STDIN
by BrowserUk (Patriarch) on Sep 30, 2014 at 17:08 UTC
    I included that in my first reply to you

    Yes. But subsequent to that you discovered that at least som of your systems no longer displayed the symptoms; hence my asking for "the output from perl -V on the affected system?

    My hope was that it might be using some olther version of Perl that might explain the difference.

    Anyhow, I cannot reproduce your problem on my system with any of the versions of perl I have available (including 5.18) and I don't have access to a 2012 OS; nor can I posit any reason for the behaviour you are showing outside of some wrapper environment (eg. "built in shell of Komodo Edit").

    As the problem seems to be related to the version of the OS you run the code on rather than Perl itself; my best suggestion is to look there for differences -- eg. permission differences that might affect the inheritance of open handles or some such.

    Another possibility would be to try substituting a piped-open for the backticks; or perhaps look at using Win32::Process to give you more control over the thing.

    Or, if you have a MS support contract, try contacting them to see if they are aware of any differences in the OSs that might explain the symptoms.

    Sorry for the hand-wavey reply, but nothing I am aware of begins to explain what you are seeing on this limited set of systems.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Well thanks for you input. No other wrapper environments were being used, I just used the Komodo edit to write the script and figured I could also use to test it. On all of the other test systems I have referenced that standard windows command prompt was used. I did try using piped open, that had the same effect. Never tried the Win32::Process however so that could be a worthy avenue to investigate.

      Also tried this again on a Windows 8 system, and it is also affected if you have access to one of those machines to try it out. I appreciate your time, nothing I'm aware of could explain this behavior in the slightest and am left just completely baffled. It is perfectly recreateable though on every 8 or 2012 system I try so it can't be a fluke. As you say there must be a difference between the 2 versions of windows. I'm not confident that I will be able to find the reason behind this but I will investigate and report whatever (if anything) I find.

      Thanks again!

      Well I can't say I solved the root of the issue, I think I have found a viable workaround detailed in my latest update to the original post. Thanks again for all the help!