PDA

View Full Version : Templating, CMS, etc


bmoyles
06-04-2003, 06:20 PM
Hey Guys,
What do you guys use for web-enabled perl scripting these days? I can't get into PHP--just don't like it.
I've looked at stuff like Mason, Template Toolkit, CGI::Application, HTML::Template, and a few others and haven't been able to decide.

Lets say you're building a hypothetical app...say, a recipe database.
How do you structure the app so html is separate from code which is mostly separate from stuff like data access? Any recommendations on techniques, modules, etc that make this possible in such a way that code is easy to maintain and extend, yet doesn't add a lot of work (like something like EJB would do?)

sicarius
06-04-2003, 10:35 PM
Well, I know you said you don't like PHP and I don't know Perl. So all I can really offer is how I do this type of thing myself (in PHP) and then hope for your sake that there is some way to do it in Perl.

Basically I have snippets of HTML code in template files. Then the template files get read dynamically into some HTML file prior to being sent to the user's browser.

In PHP there is a function called readfile that will execute any PHP code that happens to be in the file you are reading in (i.e. the template). This allows you to use variables for things like attributes.

This approach works really well in conjunction with Cascading Style Sheets (CSS).


Hope this sets off some sparks.

iDxMan
06-07-2003, 02:43 PM
I think you've hit the big 2: Mason and HTML::Template. Personally I don't use perl any more for web content (PHP), but you're probably better off with one of the above. Perhaps start with HTML::Template and see how it works for you.

I wont get into the PHP deal, but frankly its not that far off from perl. (syntax-wise)


-r

bmoyles
06-09-2003, 11:20 AM
I've really really tried to like PHP. Some of the shortcomings of the language just feel dirty (no namespaces for one). The syntax *is* similar, but its the differences that bug me :) It's similar enough to Perl to confuse me when I'm trying to get something accomplished :) No fun switching between the two.
I'm probably soured on it from having to maintain some pretty ugly PHP code too.

EnergyRecruit
11-18-2008, 08:25 AM
ome of the other answers here have not really taken into account that
you may not have ever heard of some of those languages, so here's a bit
of clarification.There are two main sections to web programming: Front End Languages (Web Design) and Back End Languages (Web Development). Front End - is what you can see, all of the visual elements, special effects and dynamic content (stuff that moves) and back end is what you can't see, database driven applications such as password protected areas, shopping cart
systems, applications that take information from the user and store it
on a server.

Swipetek
11-18-2008, 10:32 AM
Dud PHP is where it is at. HTML is okay but PHP is like the internets revolution of recent times