in reply to Confused about Fork and System
system() waits until the running program has completed its execution before running the next line. So you are opening mozilla and then perl waits for you to close mozilla before it tries running the next one.
I was going to introduce a way of forking each URL into the browser, but I thought of using backticks, which do not block until execution is complete. So you end up with this:
my @urls = ( 'www.perlmonks.org', 'www.metafilter.org', 'www.slashdot.org' ); `mozilla`; `mozilla -remote "openURL ($_, new-tab)"` for @urls;
Update: Just to point out one little thing, the system ("mozilla -remote openURL (www.perlmonks.org, new-tab)"); isn't quite correct. The command to remote has to be contained within quotes, so something along the lines of system ('mozilla -remote "openURL (www.perlmonks.org, new-tab)"'); is necessary. :)
If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.
|
|---|