[...] be replaced by another table that my script will generate
Given that you're posting here in PM, I assume that you're talking about a Perl script. This script works on the server side, so if you need to do computation locally on the client side the suggestions given above by others should suffice.

OTOH, if what you want to do is server side, all you have to do is to introduce a little logic inside your script. Basically, your script must cope with the generation of both the original page, and the target page. What table you have to display actually depends on what parameters the browser sent to the server, i.e. if the button was pressed.

This kind of situations should be handled quite well by CGI::Application: for each possible "state", or "view", of your application, you can program an ad-hoc "run-mode". In this way, you can have the default run-mode display the first table, and program a dedicated run-mode to display the other table. You'll notice that the example provided in the documentation gives you three run-modes: one with a starting query form, one with a general table, one with the details for an entry of the intermediate table - this should be a fairly useful starting point.

Anyway, this is only one of the possible ways. You can Super Search for stuff like CGI and templating systems, without forgetting to see in Tutorials and Categorized Questions and Answers as well.

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

In reply to Re: clearing a page by polettix
in thread clearing a page by Anonymous Monk

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.