Re: Automatic execution of a CGI program on a web page besides a counter
by belg4mit (Prior) on May 26, 2002 at 21:27 UTC
|
| [reply] |
Re: Automatic execution of a CGI program on a web page besides a counter
by JayBonci (Curate) on May 26, 2002 at 21:48 UTC
|
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:
- a) Moving around images, text popups, mouse events, etc. Dynamic as in Dynamic HTML, or...
- b) Generating dynamic content that requires interaction with a database, cookies, or customization based on users
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
| [reply] [d/l] |
Re: Automatic execution of a CGI program on a web page besides a counter
by theorbtwo (Prior) on May 26, 2002 at 21:26 UTC
|
If you know how to do it for a counter, then do it just like that, only more so.
No, really.
We are using here a powerful strategy of synthesis: wishful thinking. -- The Wizard Book
| [reply] |
Update: Automatic execution of a CGI program on a web page besides a counter
by Popcorn Dave (Abbot) on May 27, 2002 at 04:45 UTC
|
Thanks to all who offered their help!
I just got off the phone with my ISP and have found out the following information - your mileage may vary. :)
I already knew that browsers look for index.html when you type in www.myhost.com
What I found out was ( and forgive me if this is commmon knowledge ) that failing the index.html page, the next in the sequence is index.htm, then index.*.
So to make an index page that changes every time the browser opens it, I can do a CGI script to accomplish this and just name it index.cgi and the browser will take care of the rest.
Like I said above, your mileage may vary.
p.s. Can someone point me to a node on how to update an original post? Thanks!
Some people fall from grace. I prefer a running start...
Update 5/30/02
After playing around with this last night I discovered that my provider does NOT handle a .pl file well. No matter what your permissions are, it wants to send you the source.
However changing the extention to CGI worked just fine. | [reply] |
|
|
| [reply] |
|
|
PopcornDave,
In regards to what chromatic said, you should look into pointing users that go to "www.myhost.com" to index.shtml. By having an index written with SSI and Perl, i think you'll be able to reap the most benefits.
I'm not against writing a whole website in Perl, however,
| [reply] |
|
|
Actually, this depends greatly on the server-side configuration. For apache, you can define in httpd.conf what files are considered "index" files. On mine, it will check for an index.html, index.cgi, or index.php. If you want to repoint to a CGI type file and index.cgi is not processed, try an index.html with a "refresh" metatag that points to a new page.
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=/cgi-bin/index.cgi">
| [reply] |
Re: Automatic execution of a CGI program on a web page besides a counter
by Anonymous Monk on May 27, 2002 at 12:28 UTC
|
I fail to see what's so Perl specific about this question.
The answer is 'Yes', but that has absolutely nothing to do
with Perl. The answer would be the same, regardless of the
language you write your web stuff in.
Only thing that matters is how HTTP works. The browser issues
a request to an HTTP server. The server then responds, usually
by sending the object. What happens between the arrival of
the request and the sending of the response is up the server.
You can do anything you like - in any language you like. | [reply] |
Re: Automatic execution of a CGI program on a web page besides a counter
by BUU (Prior) on May 26, 2002 at 21:09 UTC
|
I fail to see exactly what your trying to do. If your just trying to have a script run every so often, look into cron jobs. If your looking for a 'dynamic' homepage, then write the entire thing in perl, and have the script pull and/or execute the other parts you need.
In short we need more information on what exactly you are trying to accomplish. | [reply] |
|
|
| [reply] |