Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Best way to generate HTML forms

by nysus (Parson)
on May 24, 2001 at 18:24 UTC ( [id://82916]=perlquestion: print w/replies, xml ) Need Help??

nysus has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

Using CGI.pm to generate HTML seems a little cumbersome and inflexible so I'm contemplating using my HTML editor (DreamWeaver) to generate the forms and then cutting and pasting the code into a Perl 'here' document for use in my .cgi script. I'd like to know if there are any drawbacks to doing this.

My concern is that I read a post a a week or two back which basically said 'here' documents were considered bad programming form. The poster didn't provide a reason. Is there something I should know? TIA.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar";
$nysus = $PM . $MCF;

Replies are listed 'Best First'.
Re: Best way to generate HTML forms
by AidanLee (Chaplain) on May 24, 2001 at 18:26 UTC

    I'd put my vote in for the Template Toolkit

    As to the reasons for avoiding heredocs, it has to do with keeping your logic (code) separate from your presentation (html), which is one of the early fundamental theories in good programming practice. I'm sure you'll find plenty of posts regarding this through SuperSearch

Re: Best way to generate HTML forms
by Sherlock (Deacon) on May 24, 2001 at 18:31 UTC
    I'd says templates are definately the way to go. Check out HTML::Template Tutorial and one of my previous posts Interactive Form Creation/Maintenance to see how to use it. Basically, it will allow you to create your HTML file independantly from your Perl, which makes the markup generation go much faster. In this case, it would allow you to use DreamWeaver to create the markup for you.

    I hope this helps and good luck.

    - Sherlock

    Skepticism is the source of knowledge as much as knowledge is the source of skepticism.
Re: Best way to generate HTML forms
by blue_cowdawg (Monsignor) on May 24, 2001 at 20:45 UTC

    FWIW: The current consulting assignment that I am on the client creates bill presentment and bill payment applications for third parties. In their baseline code they make extensive use of the HTML::Template module and an OO approach to generate both forms for gathering input for processing and presenting information from SQL queries.

    Without disclosing proprietary information I can say that they use Dreamweaver® to create the HTML and pop it into some simple modules that just return the HTML. The HTML is then passed through HTML::Template for variable substitution and the pages are then rendered. Very slick.

    The beauty of this arrangement is that bill presentment and collection is generally the same no matter who or what the biller is. The firm gets to settle on a code base and then reuse that code base on only modifying the presentation and business logic.

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Peter L. Berghold --- Peter@Berghold.Net
    "Those who fail to learn from history are condemned to repeat it."
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://82916]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2024-04-23 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found