http://qs1969.pair.com?node_id=681101


in reply to Trouble with Win32::GUI app spawning child processes

Two ways. Change your backticks command to

  1. system q[start http://ourserver];.

    This will launch their default browser, whichever that is, and won't block.

    Or just a new tab in the existing running instance.

  2. system 1, q["C:\\PATH\\IEXPLORE.EXE"  http://ourserver];

    This won't block either, but will start a new instance of that specific browser, if it happens to be installed, regardless of what the user prefers.

I've don't really do windows gui stuff, so have no idea how to persue this. Have any monks got an pointers?

Tip: Don't even consider using fork on Win32 until you are aware of how it differs from the same call on *nix.


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.

Replies are listed 'Best First'.
Re^2: Trouble with Win32::GUI app spawning child processes
by reasonablekeith (Deacon) on Apr 18, 2008 at 08:45 UTC
    Many Thanks BrowserUk

    I went for the second option, which opens a new instance of IE for me, rather than the first one, which took over existing IE windows that were running (I think you got your descriptions the wrong way around.)

    I still need to find out what the difference is here though. I thought system and backticks differed only capturing output. I don't really understand why these calls don't block.

    PS Sorry for the delayed reply

    ---
    my name's not Keith, and I'm not reasonable.

      Briefly

      1. system q[ start url ]; works because it uses the win32 start command.

        The nice thing abut this is that the start command will look up the current users preferred browser and start it with the url supplied. So, for you it may start IE, but the same command for me it would start Opera. For someone else it might start Firefox.

        For details type help start at a command window.

      2. start 1, ... works because under win32, Perl has a built-in extension that does an asynchronous spawn if the first parameter to system is the magic token '1'.

        I can't point you to the documentation because I found out about it right here at PM. Probably from tye.

        Possibly here, or here or here ...


      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.