I mean no disrespect if I am incorrect, but perhaps you are confusing server-side with client-side. Perl and CGI(.pm) run server side. The results are dumped to a page, and that is all. You can generate JavaScript code with perl (it's a little tricky, and you'll fall in love with escaping characters all over again), but once it's in the hands of the browser, Perl/CGI stops working.

The counter example you listed is a little skewed. Counters usually work like:
<img src="mycounter.pl?acct=mysomething&foo=bar&eep=yah">
The image is then dynamically generated by the counter script and you have something that has a dynamic feel, when really it's some dynamic image magic being thrown together into a static page, and all of the magic occurs on the server.

From there, it becomes the responsibility of the web page to be dynamic, and there is the realm of JavaScript.

Now, the answer to your question relies mostly on what you mean by dynamic. By dynamic do you mean: The first one maps to using JavaScript, and the second one maps to using Perl and CGI. It's likely you want a combination of both. As a somewhat interesting side note, ActiveState offers PerlScript, which I think can be run as a dynamic browser technology using the DOM, but I've really never tried it. Now THOSE would be some powerful web pages, but that's a strange dependancy. Good luck with your project. If you provide some more details as to what you'd like to accomplish (perhaps demo the direction you'd like to go in), the crazy camel riders might be able to help a little more.

    --jb

In reply to Re: Automatic execution of a CGI program on a web page besides a counter by JayBonci
in thread Automatic execution of a CGI program on a web page besides a counter by Popcorn Dave

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.