in reply to open browser

Here is some code that starts off IE as a separate process, then sleeps - in your case, you would run your TK code.

THe parent program will not terminate until the TK code finishes AND IE is closed.

# Start child process defined(my $pid = fork) or die qq(Can't fork: $!\n); if ($pid==0){ #Child process print qq(In Child .. starting \n); # Start IE system '%ProgramFiles%/internet explorer/iexplore.exe','http://cnn.c +om'; print qq(child returns - child quitting\n); exit 0 }; # THis is the parent Process .. do TK stuff here.. print qq(PARENT:$pid doing...\n); sleep 5; print qq(Parent done\n); ## Code will HANG here until Iexplorer is closed....
Tested on Windows XP with perl, v5.8.0 built for MSWin32-x86-multi-thread.

    Earth first! (We'll rob the other planets later)

Replies are listed 'Best First'.
Re^2: open browser
by Anonymous Monk on Jul 15, 2004 at 05:37 UTC
    sorry ...I am verry new to perl, so how do I use that code. Where should i put it.(the server code above I download it from internet)
Re^2: open browser
by Anonymous Monk on Jul 15, 2004 at 05:47 UTC
    I did it, and it work fine.(so ignore my above reply). But I want the server to run first then open the browser. With that code above the browser will open first and will not work, as the server in not yet ready.

    so could the server run first. and if it posible the browser will open in few second delay? Thanks

Re^2: open browser
by Anonymous Monk on Jul 15, 2004 at 06:05 UTC
    I think I maybe put it at the wrong place, I manage to delay opening the browser by typing sleep 15, but the browser could not work.

    This is what the server wrote;-

    Client: 1 127.0.0.2 Sun Apr 25 14:10:51 2005 Header: GET / HTTP/1.1
    Free to wrong pool 1eabdf8 not 1833918 at c:\nehnu.exe line 270 <gen1> line 1.