in reply to Launch and forget

Uh-oh..
I think I just realized what I've done wrong here..
It's got to do with the filehandle right? Can't open the same one twice.. doh!
So, how do I solve this then? I was using backquotes to lauch IE before, but that was worse, it would hang the app until you closed IE.. I would rather not add any more modules to the prog because I am using perl2exe, and currently my 5k program is at 1.8 meg when compiled. Note, I am using perl2exe so that I can distribute this without having to install perl on ~80 machines.

Any ideas?

Replies are listed 'Best First'.
RE: RE: Launch and forget
by merlyn (Sage) on Sep 02, 2000 at 09:19 UTC
    Perhaps something like this:
    { defined(my $kid = fork) or die "Cannot fork kid: $!"; unless ($kid) { exec "/path/to/ie", "param1", "param2" or die "Cannot exec ie: $!" +; } }
    If your Tk program runs for a long time, you should "double fork" to make IE the grandkid, and then wait for the kid, or else invoke waitpid from time to time to ensure that the kid process gets reaped occasionally.

    -- Randal L. Schwartz, Perl hacker

      I tried this, and it crashes my program on windows. :-(