system only returns when the command that is launched returns. In your case, the first system only returns when mozilla is finished, so the script only continues after mozilla has exited. One way to deal with this is to fork off a child to run mozilla. Something like:
#!/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"); }
This code is untested.

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-


In reply to Re: Confusued about Fork and System by robartes
in thread Confused about Fork and System by SteveTheRed

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.