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

I want to open iceweasel from a perl script. "system "iceweasel -new-window '$url'; " do the job properly. But after some treatments, I would like to close this newly opened window, but I can't find how. Thank you, Pierre

Replies are listed 'Best First'.
Re: end "system"
by moritz (Cardinal) on Oct 25, 2007 at 11:38 UTC
Re: end "system"
by PierreL (Novice) on Oct 25, 2007 at 11:42 UTC
    How to get the job's PID?
      fork returns the child's PID in the parent process, and when the child process execs, the PID doesn't change.
Re: end "system"
by BrowserUk (Patriarch) on Oct 25, 2007 at 23:19 UTC
      It actually creates a pid and kill it, but the window of iceweasel does not disappear. Which is strange because the pid is the one of iceweasel. my $url="http://www.google.fr/"; my $pid = open CMD, "iceweasel -new-window '$url' |" or die $!; print $pid; sleep 10; kill $pid; close CMD;
        my $url="http://www.google.fr/"; my $pid = open CMD, "iceweasel -new-window '$url' |" or die $!; print "$pid\n"; sleep 10; my $k=kill 'KILL',$pid; print "$k\n"; close CMD; the process is actually killed, but the window opened doesn't shut.