Gang,

I'm forwarding this to the list. Sorry Danny for sending it to your personally.

Rodney Hampton

Danny Rathjens wrote:

Looks like you accidentally replied to just me instead of the group.
Don't ask me why we don't have a reply-to header on the list, ;)

Rodney Hampton wrote:

Perrin, Danny, et. al.

I looked over the comparison document as well as the perldocs on all the templating systems I could find on CPAN before embarking on this journey.
I really only need 3 tags: one to link the templates together, one to bring in images, and one to call code that can by dynamically inserted. Every item in my application's database (templates, images, and other files) has user and group permissions that need to be checked on access. Thus, any templating system that did caching is pretty much out of the running because as soon as I revoke a user's privileges or change permissions on the item, I want access to change immediately. Also, when an advertiser makes a change to one of his/her templates, it needs to propogate immediately. Additionally, I need to track users so I had to be able to establish and maintain a session so this was a definate requirement. Also, I needed to be able to selectively protect certain areas of the application with login screens (not necessarily the same one depending on where you navigate). This is the underlying architecture for a client I have but I intend to make it modular enough to use for future projects. I've done some benchmarking on what I've built already and am satisfied with the results. I seem to be able to serve up 30 concurrent connections sending dynamic content all day long and have it sever between 25-35 requests per second at around 300 - 375 Kbytes/sec. I've compiled mod_perl with DSO and it's never shown any memory leaks for me (YMMV). That was done on a 851Mhz Dell Latitude laptop with 128MB RAM and I ran apache benchmark from this box as well (which skews my results but shows it can handle the load). The production server need only handle up to 50,000 users per day and it will be on much better hardware so I think I'm in fine shape so far. I'd like to think that I'm heading in the right direction. Believe me, I prefer to pull down modules from CPAN when possible. For example, I would eventually like to chain my PerlHandlers and zip up the content before delivery. There are modules to do that already so I won't be rewritting Apache::Filter from scratch for instance. I'd also like to pretty up the html before outputting it to the client browser - I'm pretty sure there's a module in there for that as well.

Anyway, I'm not trying to say that what I'm doing is better or worse than what has come before. I just happen to have different requirements and I didn't think that the other systems out there were going to be both lightweight and allow me to meet my need for access control.

Rodney Hampton
Danny Rathjens wrote:

Very useful document comparing templating systems:

  http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html

Perrin Harkins wrote:

Rodney Hampton wrote:

Let me preface it by stating that I'm building a very simple templating application.



[...]

Not satisfied, I wanted to make it possible to do something like:
<% code_ref Util::Test_Util::test_expand %>
and have it swap in the text output from the sub into the template. That way, unlike other templating applications, I could get away from writing my own mini language and use the full power of perl in a sub called by a simple tag in the template.



Do you realize that almost every templating system on CPAN already does this? If you are doing this because you think you've hit on a new feature, stop now and download one of those. If you're doing it because hacking perl is fun and you're in no rush, then go ahead and have a good time.

- Perrin




Reply via email to