[thelist] CALLING SSI WITHIN CGI
Squires, Michael (michael)
michael at sequent.com
Tue, 18 Jan 2000 06:13:36 -0800
I think that what you want to do is to create a perl library (lib.pl) that
has the "banner" function in it. Have this function just print out the body
of the banner (that is, do NOT print things like "Content-type ...."). It is
designed to assist in writing cgi scripts - it is not a stand alone cgi
script itself.
Once you have that, then you can call it from any other cgi applications. So,
you can have "app1" and "app2" both do a "require lib.pl" and then just call
"banner();" wherever you want the banner code in the application's output.
Then create a "bannercgi" program that DOES operate as a full cgi program -
that is, it emits the "Content-type ...." and then calls "banner();";
Now your static pages can put a "<!--#include virtual="/cgi-bin/bannercgi"
-->" in them and get the banner. All of your applications can use that
function too. And you have the banner code for the whole site in a single
library, so all you do is change that library and you change the banner logic
/ appearance for the site.
We do this type of thing all over with mastheads, navbars, footers, etc.
Makes for a very clean structure.
Michael Lee Squires
IBM NUMA-Q Web Architect
michael@sequent.com
+1 503.578.9891