Hi!
Thanks for the quick reply. I know it would be much simpler if I just
installed mod_perl and some kind of a framework (I've started learning
Mason and I think I would be able to do what I want using this solution
) and rewrote the whole webpage but that's too much work and it's really
not necessary :) The site is not big, we don't have much traffic so such
inefficiencies don't cost us much. I just wanted to know if there was a
straightforward solution to this problem and I figured there could be
problems with such injection of Perl into a php-dominated application :)

I will look into the HTTP::Server::Simple::CGI and your framework but
I'm not sure I'm knowledgeable enough to deal with that :) I mean I
don't really get the idea of a phps being only proxies. At the moment a
sample php file where I include my own cgi script looks like this:

<?php

include 'maincore.php';
include 'header.php';

echo file_get_contents('some/location/mycgiscript.cgi');

include 'footer.php';
?>

However, there are also a lot of files where there is much more php code
and no perl code as well as small panels written in pure perl :) How
would the distinction of what serves which pages work?

I know that, in the long run, such distinction and such way of doing
things makes little sense but, like I said, I don't want to restructure
the whole site (I want to keep the php engine which is rather useful and
user-friendly) but I want to use my CGI scripts in an efficient way. To
be honest, the most efficient way would be to rewrite those scripts in
php which shouldn't be too big of a problem but I'm really interested in
Perl right now and that's where I stand :)


Rene Schickbauer pisze:
Hi!

Now, the thing is that the PHP scripts also connect to the database and, presumably, uphold the connection over the duration of the session so as not to disconnect and reconnect continually when the user browses the website.

My question is - is it possible to do the same thing with those CGI scripts?

CGI scripts are basically scripts executed at the commandline with a few parameters and environment variables set (each call normally starts a new instance).

You could look into the various web frameworks if and how they solved the problem. If you can't install anything on the server besides CGI scripts, you're probably out of luck, though.

If you CAN install additional software on the server, mod_perl could be the way to go. Or run your own small perl-based server for those pages on another port, HTTP::Server::Simple::CGI (or my Maplat-Framework) might fit your profile - you may even run them as backend only on localhost and use a PHP script as simple proxy 8-)

It really depends on what you're planing in the long run.

LG
Rene



--
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/


Reply via email to