It"s not PHP, is it? (potential new CPAN module)
am 21.07.2007 09:16:05 von Colin von HeuringHeya!
I'm working on a Perlish web server. Have a bit of history: I once had
a job where we used PHP. It was okay, but I felt it wasn't a real
programming language. At my new job, we use Perl. I like using Perl.
When I write something in Perl, I notice things in my code I'm not used
to seeing. Some of these things are ugly, and when I try to figure out
why they look bad, I usually find that I've done something wrong. Being
a perfectionist, I like that.
The codebase at work is ugly. It's basically MVC, a lot of it is
spaghetti, and it's all very VERY crufty. We have a core .pm that's
almost 1/2MB. It could "easily" be split into at least 5 simpler modules.
So I'm writing a Perlish web server in hopes of moving the whole site
over. Maybe the server is Colin-ish, but I'm writing it in Perl with
the intent of making it Perlish. Here's the basic idea: the server
(running in a persistent Perl interpreter) receives a request and begins
validating it. It determines whether the requested file is dynamic
(currently by checking -x), eval()s it if so, and sends it if not.
Some more details:
It currently only works under mod_perl2, but there's a Driver superclass
that should let us use any server.
It's name (at the moment) is SDH (Simple Dynamic Hypertext), because I
like TLAs and that one is only used once in technology (that I know of).
In medicine, it means "subdural hematoma," which I find amusing, if
macabre.
I like parentheses.
I "came up with" this weird (to me) 3-stage configuration system.
SDH.pm require()s SDHConf.ph, which sets $SDHConf::srv_root. This
variable is used to find conf.yml, which contains the static
configuration, including the parameters to pass to DBI::connect() so
that we can get the dynamic configuration.
So I present an essay question. I expect your essays on my desk by 8 AM
Monday. ;-)
Should this become a CPAN module? Is there anyone around who is
particularly good at style proofing, documenting, and testing, or am I
going to have to buy a big pile of tuits?
Ciao!
-CvH