http://qs1969.pair.com?node_id=1113082


in reply to beautiful form(s) with CGI

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 perlcritic.com shows that it primarily uses Bootstrap, see http://getbootstrap.com/. There are nowadays a whole bunch of CSS frameworks available, and several JavaScript libraries, such as jQuery (http://jquery.com/).

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 http://necolas.github.com/normalize.css/3.0.2/normalize.css and http://code.jquery.com/jquery-1.11.2.min.js 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.