You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Michael Todd Glazier <mi...@Galli-Glazier.com> on 2000/06/22 03:36:24 UTC
Any reason not to SSI include Registry scripts?
As a way to speed up the CGIs but allow my designers easy access to
the html file, I'm executing an Apache::Registry CGI script from
within an .shtml document using #exec cgi . The Apache manual says to
prefer use of #include virtual, but that doesn't pass the query
string from the request. In a way this is a hacked template system. :)
Is there a reason, barring the known fact it would be faster as a
full blown module :), not to use this set-up?
Thanks!
- mt
Re: Any reason not to SSI include Registry scripts?
Posted by darren chamberlain <da...@boston.com>.
Michael Todd Glazier (michaeltodd@Galli-Glazier.com) said something to this effect:
> As a way to speed up the CGIs but allow my designers easy access to
> the html file, I'm executing an Apache::Registry CGI script from
> within an .shtml document using #exec cgi . The Apache manual says to
> prefer use of #include virtual, but that doesn't pass the query
> string from the request. In a way this is a hacked template system. :)
>
> Is there a reason, barring the known fact it would be faster as a
> full blown module :), not to use this set-up?
>
> Thanks!
>
> - mt
How about using Perl includes, like <!--#perl sub="My::Package" -->? Much
cleaner, and still consistant with other types of includes. And, since it
uses the standard Apache/mod_perl module format (sub handler and all that),
the modules you use in Perl subs can be easily moved over to full handlers
if necessary.
Perl subs requires that mod_perl be built staticalll with Apache, and that
mod_perl built with EVERYTHING=1 or PERL_SSI=1.
darren
--
If God had not given us sticky tape, it would have been necessary to invent it.
Re: Any reason not to SSI include Registry scripts?
Posted by Vivek Khera <kh...@kciLink.com>.
>>>>> "MTG" == Michael Todd Glazier <mi...@galli-glazier.com> writes:
MTG> <!--#perl sub="Apache::Include" arg="/perl/ssi.pl" -->
MTG> The book Professional Apache says this is more efficient than include
MTG> virtual since it allows scripts to be persistent, but I don't see how
MTG> they would not be using include virtual.
I have mod_perl as dynamic since I run different configs on different
boxes and I hate to have multiple binaries... The #perl doesn't work
with dynamic mod_perl.
The boot Professional Apache must assume that whatever you're #include
virtual-ing is non-mod_perl otherwise this statement wrong.
Re: Any reason not to SSI include Registry scripts?
Posted by Michael Todd Glazier <mi...@galli-glazier.com>.
At 9:39 AM -0400 6/22/00, Vivek Khera wrote:
>
>I use the include virtual in some situations. If you want the query
>string, just append it:
>
> <!--#include virtual="/path/to/program?$QUERY_STRING" -->
Do you happen to know if there's any performance difference between
using the include and virtual and using the following:
<!--#perl sub="Apache::Include" arg="/perl/ssi.pl" -->
The book Professional Apache says this is more efficient than include
virtual since it allows scripts to be persistent, but I don't see how
they would not be using include virtual.
Thanks for the reply, I appreciate the time.
- mt
Re: Any reason not to SSI include Registry scripts?
Posted by Vivek Khera <kh...@kciLink.com>.
>>>>> "MTG" == Michael Todd Glazier <mi...@Galli-Glazier.com> writes:
MTG> As a way to speed up the CGIs but allow my designers easy access to
MTG> the html file, I'm executing an Apache::Registry CGI script from
MTG> within an .shtml document using #exec cgi . The Apache manual says to
MTG> prefer use of #include virtual, but that doesn't pass the query
MTG> string from the request. In a way this is a hacked template system. :)
I use the include virtual in some situations. If you want the query
string, just append it:
<!--#include virtual="/path/to/program?$QUERY_STRING" -->
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@kciLink.com Rockville, MD +1-301-545-6996
GPG & MIME spoken here http://www.khera.org/~vivek/
RE: Any reason not to SSI include Registry scripts?
Posted by Kenneth Lee <ke...@alfacomtech.com>.
Hey, I'm doing this too! I use #include virtual to invoke
my CGI scripts to embed some dynamic objects. But to do so
my scripts have to add a if-construct to get the query string
when running as a SSI script:
if ($ENV{SERVER_PROTOCOL} eq 'INCLUDED') {
($qstr) =~ ($ENV{REQUEST_URI} =~ /\?(.*)/);
$q = new CGI $qstr;
} else {
$q = new CGI;
}
yeah, this is ugly, but i'm doing this anyway.
hope this helps.
kenneth
-----Original Message-----
From: Michael Todd Glazier [mailto:michaeltodd@Galli-Glazier.com]
Sent: Thursday, June 22, 2000 9:36 AM
To: modperl@apache.org
Subject: Any reason not to SSI include Registry scripts?
As a way to speed up the CGIs but allow my designers easy access to
the html file, I'm executing an Apache::Registry CGI script from
within an .shtml document using #exec cgi . The Apache manual says to
prefer use of #include virtual, but that doesn't pass the query
string from the request. In a way this is a hacked template system. :)
Is there a reason, barring the known fact it would be faster as a
full blown module :), not to use this set-up?
Thanks!
- mt