#!/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"); }