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

Hello all,

I want to create HTML page with minimal effort which has some drop down list, submit buttons and other stuff. Is there any way in Perl I can achieve this.

Simple code

$html->CreateDropDown('name', dataset)

Replies are listed 'Best First'.
Re: Create HTML pages with ease
by CountZero (Bishop) on Sep 10, 2009 at 06:21 UTC
    What is wrong with writing yourself a CreateDropDown method which acts upon an $html object and which returns the construct you need?

    Several modules already do that (mostly in order to generate and process forms). Have a look at HTML::Element and its various sub-modules or HTML::Widget to get some inspiration.

    The venerable CGI module also has its methods/functions to write various HTML constructs.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: Create HTML pages with ease
by marto (Cardinal) on Sep 10, 2009 at 08:27 UTC

    A very simple approach would be to use a templating module such as HTML::Tempalte to seperate your Perl code from your HTML/CSS/JavaScript. Using HTML::Tempaltes tags and loops you could conditionally create and populate selectboxes, or any other HTML for that matter.

    Martin