Chaks has asked for the wisdom of the Perl Monks concerning the following question:

I am using a system command in Perl to execute java. I have formed an array @args that have different options to execute a jar file. Something like below:
$args[0] = $rootpath."/jre/bin/java"; $args[1] = " -jar \"".$rootpath."/temp/abc.jar\""; $args[2] = " INP=\"".$inputfilename."\""; $args[3] = " OUT=\"".$outputfilename."\""; system(@args);
This gives a popup window when executed which I want to suppress and want it to run in background. I want this to be suppressed in Linux also. I tried using tild but it didn't helped as below.
my $command = "@args"; $output = `$command`;
Please help in figuring this out. I have similar post on stackoverflow http://stackoverflow.com/questions/30885201/suppress-windows-cmd-for-system-command-in-perl?noredirect=1#comment49841195_30885201

Replies are listed 'Best First'.
Re: Suppress windows cmd for system command in Perl
by BrowserUk (Patriarch) on Jun 18, 2015 at 11:57 UTC

    Try: system( 1, qq[start /b your command and args here] );


    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". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
      Ah, the days of fiddling with start. Why the F*** does Micr$oft name things with overloaded words? I think it's a plan to avoid any possible bad words in every language in the world. Windows. Surface. Access. Excel (well, at least they changed the spelling). Outlook. Office. Explorer. Natural. Publisher. Vista. Visual <anything>. Xbox.

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of

        Why the F*** does Micr$oft name things with overloaded words?

        As opposed to *nix' nice, clear, self explanatory ones: ar crontab chgrp dd ex fc fuser grep iconv ipcrm ipcs ln nm nohup od stty uucp uux yacc :)

        Aaaar cron, lay the table and change the rope. Deedee's ex f*** for using er. Grope I, won't convert me. I pee in the cream & pee in the cakes. Bleeeeeeeeeeeeeech.


        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". I'm with torvalds on this
        In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
      Thanks BrowserUk. I tried using that but still I see the cmd window popup.

        Hm. I cannot reproduce the problem on my machine. Neither the original problem or when using start.

        Are you running the perl script you are using from a command line; or double clicking it in the explorer?


        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.
        I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
Re: Suppress windows cmd for system command in Perl
by Discipulus (Canon) on Jun 18, 2015 at 09:53 UTC
Re: Suppress windows cmd for system command in Perl
by Anonymous Monk on Jun 18, 2015 at 09:28 UTC
      I tried using that but it did not help. Still I am getting the pop-up when system command is called. Also in my application I have some restriction to include new module like Win32. So I am looking for some other ways to remove the pop-up. If it doesn't help and including Win32 is the only way and I have the working model for it then I can take on this further.

        I tried using that but it did not help....

        No wonder Chaks, you left out critical details twice, took until this to reveal you're calling perl from c++

        So here is what you do, in c++ program, use SetChildShowWindow(0), so that when the c++ program starts programs there is no popup