in reply to end "system"

This might get you what you want:

Update: Corrections thanks to ikegami.

... my $pid = open CMD, "iceweasel -new-window '$url' |" or die $!; ... kill 'TERM', $pid; ## Maybe also use waitpid 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.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^2: end "system"
by PierreL (Novice) on Oct 26, 2007 at 07:39 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;
        Sorry, but even with the 'KILL' parameter, it doesn't close the window. Maybe it only kill the process CMD, not iceweasel itself. It is the same problem with 'system' function.
      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.