in reply to OUTPUT: inline or template_based?

Please don't inline HTML, SQL, or anything that is not perl.

In my current job, I need to clean up (rewrite) 400,000 lines of Perl/SQL/HTML/Mail/... in 800 or so CGI scripts. You can just imagine how horrifying it is. The guy who wrote it initially had run away with his life. Anyways...

I'm contemplating the idea of having each section of the program output in plain simple XML and then do the transformations to HTML/PDF/Anything using XSLT or any other XML templating tool. That way, I'd have total separation between logic and presentation.

Hope this helps,,,

Replies are listed 'Best First'.
Re: Re: OUTPUT: inline or template_based?
by kappa (Chaplain) on May 30, 2002 at 07:45 UTC
    I agree with everything, except for separating SQL. I think this is not practical at all. There's no need to do it, really, as you are the man who writes both SQL and perl, usually. Perl glue code is as a rule tightly dependent on SQL and you don't want to change one of them without at least reviewing the other.