I definitely recommend using a template engine and
using an Model-View-Controller (MVC) framework; the
template engine helps with the view part.  I was first
introduced to it on the tutorials under documentation
on perl.apache.org. It took me a little while to
figure out how to create & instantiate objects in
perl, but once I figured that out, it has been smooth
sailing since.  I have since learned to apply the
concepts to my php web programming at work.

greanie  

--- Frank Wiles <[EMAIL PROTECTED]> wrote:

> On Wed, 13 Sep 2006 13:03:55 +0300
> "Greger" <[EMAIL PROTECTED]> wrote:
> 
> > Is there anything in particular that one should
> take into account
> > regarding modperl and design patterns vs trad
> CGI-scripting?
> > 
> > As for now, I return XML from the package methods,
> and use XSLT for
> > the transformation to XHTML. This works very well,
> seems flexible,
> > but are there better ways?
> > 
> > I guess it all depends on what one is doing,
> naturally. In this case
> > it is an application using the mysql database.
>  
>   There are a bunch of people who do this, from Perl
> CGIs, mod_perl,
>   and even with other languages/frameworks/etc. 
> 
>   It's a perfectly reasonable way of doing things,
> but does cause you to
>   do a bunch of extra processing.  Putting your data
> into XML, and then
>   transforming it into XHTML with XSLT.  
> 
>   What I typically recommend to people is that they
> use a template
>   engine like Template-Toolkit.org.  You simply pass
> it a Perl data
>   structure and then you have all of the same
> transformation
>   possibilities as XSLT ( at least as I understand
> it ).  And if you
>   ever need the data as XML, you simply create a
> template for 
>   that ( or pass a special option to your handlers
> to return XML,
>   etc. ). 
> 
>   There are tons of different ways to do it.  What I
> would look for is
>   to optimize for the "general case" of "I need to
> deliver XHTML" and
>   worry about "I might need this as XML at a later
> date" for that later
>   date. :) 
> 
>  ---------------------------------
>    Frank Wiles <[EMAIL PROTECTED]>
>    http://www.wiles.org
>  ---------------------------------
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to