Suppress console windows when using backticks

Posted by troyt on 2006-07-06 10:34
OS: Windows | Product: Perl Dev Kit | tags: gui perlapp
Question: 

How do I stop console windows from popping up when i call commands in backticks?

Answer: 

Using perlapp's --gui option should hide normal perl command line output, but system commands called within backticks may still open command line windows. To suppress this, try adding the following block to your script:

BEGIN {
    Win32::SetChildShowWindow(0) if defined &Win32::SetChildShowWindow;
}

This should work using ActivePerl version 632 or later.