in reply to Confused about Fork and System
This code is untested.#!/usr/local/bin/perl -w use strict; die "Something fishy: could not fork.\n" unless (defined(my $pid=fork( +))); if ($pid) { # $pid has a non zero value, so this is the parent sleep 5; # give mozilla some time to start up system ("mozilla -remote openURL (www.perlmonks.org, new-tab)"); system ("mozilla -remote openURL (www.metafilter.org, new-tab)"); system ("mozilla -remote openURL (www.slashdot.org, new-tab)"); waitpid($pid,0); # wait until mozilla is finished } else { # $pid is zero, so this is the child system ("mozilla"); }
If Windows supports backgrounding a process from the shell, another solution is to run mozilla in the background in your first system(), but I have no idea whether that's possible or not.
CU
Robartes-
|
|---|