Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

beautiful form(s) with CGI

by adriang (Sexton)
on Jan 13, 2015 at 12:25 UTC ( #1113072=perlquestion: print w/replies, xml ) Need Help??
adriang has asked for the wisdom of the Perl Monks concerning the following question:

Hi all
Hope this is the right place to post my question. I want to know how is possible to make some beautiful form(s) with CGI like for example the web site.
Thanks in advance

Replies are listed 'Best First'.
Re: beautiful form(s) with CGI
by karlgoethebier (Monsignor) on Jan 13, 2015 at 12:49 UTC
Re: beautiful form(s) with CGI
by marto (Archbishop) on Jan 13, 2015 at 13:19 UTC uses boostrap among other things. To make your task easier, download and customise bootstrap, once you've got everything looking the way you want witout involving Perl use this as the basis for your template. If you are considering using CGIs built in CGI HTML generation facilties I'd strongly advise against this. See Template/HTML::Template for example.

    On a related note there are other frameworks which can make this sort of development easier, (from CGI) note: HAS BEEN REMOVED FROM THE PERL CORE

    If you upgrade to a new version of perl or if you rely on a system or vendor perl and get an updated version of perl through a system update, then you will have to install yourself with cpan/cpanm/a vendor package/manually. To make this a little easier the CGI::Fast module has been split into its own distribution, meaning you do not need acces to a compiler to install

    The rationale for this decision is that is no longer considered good practice for developing web applications, including quick prototyping and small web scripts. There are far better, cleaner, quicker, easier, safer, more scalable, more extensible, more modern alternatives available at this point in time. These will be documented with CGI::Alternatives.

    For more discussion on the removal of from core please see:

    Update: Edited formatting.

      Thanks all for the good advice,
      I will start to use a framework but I'm not sure if to start with Catalyst or dancer or dancer2?
Re: beautiful form(s) with CGI
by Anonymous Monk on Jan 13, 2015 at 13:08 UTC

    Yes it is, although CGI isn't directly involved since it's mostly done on the client side with a combination of CSS and JavaScript.

    So for example, a quick look at the source of shows that it primarily uses Bootstrap, see There are nowadays a whole bunch of CSS frameworks available, and several JavaScript libraries, such as jQuery (

    There are a couple of Perl web frameworks that are "more modern" than CGI which you might want to look at, see for example Mojolicious or Catalyst. But if you're using CGI, here's an example of how you might tie CSS & JavaScript libraries into your page, assuming you've downloaded and to your local directory:

    print start_html -style => { -src => [ 'normalize.css', 'mystyle.css' ] }, -script => [ { -type=>"text/javascript", -src=>"jquery-1.11.2.min.js" }, q{ alert("I'm some embedded JavaScript"); } ];

    You'll still need to read the documentation of whatever frameworks you decide to use to see how to access their functions, which is usually not a question of Perl but of CSS, HTML and JavaScript. CGI provides a -style argument for most of its HTML functions that can be used to specify CSS classes and other style elements.

Re: beautiful form(s) with CGI
by Anonymous Monk on Jan 13, 2015 at 23:26 UTC
Re: beautiful form(s) with CGI
by sundialsvc4 (Abbot) on Jan 13, 2015 at 18:18 UTC

    Design decisions like “which framework to use” go far, far beyond considerations of CSS and beauty.   I’d simply suggest that you fully design and map-out your intended application before you subsequently choose which framework ... or for that matter, which programming language(s) if any(!) ... to use in constructing it.

    (As great a language as Perl may be, never overlook the growing possibility that you do not, in fact, have to develop a new custom web-site at all in order to solve your business problem.)

    The implementation strategy (CGI, Perl module, FastCGI, etc.) is likewise something that you can and should defer for a long time.   I know of several production web-sites used by rather big companies which are ... “good ol’ CGI.”

    The definitive illustration of what can be done with CSS is, certainly, the CSS Zen Garden, which presents a wide variety of (perfectly nonsensical content ...) web site presentations from which you can freely pick and choose.   All of the variations of that content are devised using CSS, which is the key point that the site wishes to demonstrate.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1113072]
Approved by shmem
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2018-07-20 18:38 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (439 votes). Check out past polls.