Hi. I'm working on an Embper/modperl problem. I'm working with some
people who are redesigning their site. They've written a 2 tier
application server in perl using Embperl, DBI and an assortment of
modules.
Looking at performance, it was running in a pure cgi environment. I'd
like to see us using mod_perl, however there are some issues that I'm
having a hard time resolving.
Background We're using apache 1.3.9, perl 5.005_03, CGI.pm 2.46, and
Embperl 1.2.1. The problem I'm having is (I believe) a name space
issue with Embperl. The symptom is, I'll hit an embperl page and it
seems to work, but the code doesnt re-execute when you reload.
As it stands, each directory has an index.cgi and a perl module that
controls what templates get read in and executed. The template files
share certain common files with embperl code (the top nav bar, the side
bar elements, etc). Its these files I'm having a hard time with.
The basic flow is:
browser makes a request
cgi program looks at the requested page and checks to see what template
to load.
The template is looked up in a hash table that retures what file to
open.
The file is opened and it may contain embperl that opens and evaluates
other files.
All the code is executed.
A page gets returned to the browser.
The server seems to be putting the 'included'embperl files into the
same namespace. Each page works fine if you hup the server, going
from one section of the site to annother results in the top nav
bar being incorrectly displayed.
Thats if we use Apache::Registry or Apache::PerlRun. If I use
Apache::PerlRun, and set PerlRunOnce everythign works fine. While
this gives us a decent speed increase from preloading the modules,
I'd like to not have to use PerlRunOnce, and ideally be able to use
Apache::Registry.
Some code.... in a typical template, there's embperl like this:
[* Execute($base.'/'.$top_nav,$app); *]
$top_nav is a file that contains more embperl code. I've tried looking
through the symbol table under /apache-status but I'm not really sure
where to start looking. All cgi's and modules are written with the use
strict pragma and have taint checking turned on. Just about all the code
is OO perl. While I'm not leading the project, I'd love to see it run
under mod_perl. I feel the speed/performance gained would be well
worth it.
So I guess what I'd like to know is, has anyone used Embperl the way
we are? Where, instead of a .epl or a specific file type, you mix
embperl and regular perl? Where embperl code gets run from inside
annother module that may also do things like set cookies, connect to
databases or whatever.
Mental
--
"You make insanity respectable."
--Helcat on the subject of Mental
PGP 2.6.3a Public Key: http://www.neverlight.com/Mental-PublicKey.pgp
PGP signature