logo       

Re: [Boston.pm] Re: Example(s) of text piece & code piece?: msg#00046

Subject: Re: [Boston.pm] Re: Example(s) of text piece & code piece?
One of the places for whom I work uses Perl for all of its development and, when I first joined about 8 months ago, had all the HTML for dynamic pages embedded in the CGI code. My supervisor had tried using Mason before and was unsatisfied with it so I convinced him to give the module HTML::Template a try. We are now in the process of converting the pages in what i believe is a huge step forward. I've been using it for about a year now (started using it for another client), and I really love it. In fact, our adoption of it came in part because we had signed a contract with another website that wanted us to recreate some our pages with their branding and run it on our site. Without adopting separating out the content, I doubt we could have met the terms of the contract in the time period specified and, even if we had, maintenance would have been a pain.

HTML::Template works by inserting tags similar to HTML tags into the HTML document and then importing the document into the cgi, replacing the tags with the relevant data, and outputting revised HTML code. It also supports conditional statements (if..else, unless..else, etc) and loops and supports nesting. All the HTML person would have to know is a handful of template tags, only one or two if you don't need conditionals or loops. We have also used the module in the creation of our HTML emails. If there is any interest, I can post here or on my website an example or two of how I've used it (no guarantees that it will be pretty or the best possible example) but Sam Tregar's article on the SourceForge site has examples. More information can be found at http://html-template.sourceforge.net.

HTH,
Tracy Hurley
programmer - http://www.idofoundation.org
http://www.hurleyit.com

On Jan 18, 2005, at 12:24 PM, Bob Mariotti wrote:

Perhaps some readers can post some small examples of a PHP and/or perl program(s) that actually do what Uri was just stating... that being the separation of text (html) from logic (PHP/perl)?


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe