Sounds like you want to download the content of web pages. Have you tried wget? It does exactly that.

But to answer your original question (how do I open new tabs in the web browser?), you could insert the following code into the output HTML:

<A HREF="javascript:OpenMyWindows();">Open My Windows</A> <SCRIPT> MyURLS = [ "https://www.perlmonks.com", "https://www.foxnews.com", "https://duckduckgo.com", "https://www.yahoo.com" ]; function OpenMyWindows() { while (MyURLS.length) window.open(MyURLS.shift()); } </SCRIPT>

^ This will create a link, and when you click that link, several new tab will be created. BUT your web browser will block them, because they are popups. So, you have to click on Allow popups from your site.

You could create a popup or new tab as soon as the browser loads the page without having to click anywhere, but the browser will again block your popup:

<SCRIPT> window.open("https://www.yahoo.com"); </SCRIPT>

In reply to Re: Can my Perl CGI script open a new browser tab or window? by harangzsolt33
in thread Can my Perl CGI script open a new browser tab or window? by SergioQ

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.