Common Lisp guys have their CL-WHO, which makes HTML templating integrated with the \"main\" language thus making the task easier. For those who don\'t know CL-WHO, it looks
Perl's standard CGI module can do something similar:
#!/usr/bin/perl
use strict;
use warnings;
use CGI qw/:standard/;
print
start_html("An example"),
h1(
{
-align => "left",
-class => "headerinfo",
},
'this is an example'
),
"The CGI module has functions that add HTML:",
ul( map li($_),
("start_html",
"h1, h2, h3, etc.",
"ol, ul, li",
"ol, ul, li",
"table, tr, th, td")
),
"and many more.",
end_html();
That produces:
An example
this is an example
The CGI module has functions that add HTML:- start_html
- h1, h2, h3, etc.
- ol, ul, li
- ol, ul, li
- table, tr, th, td
and many more.
The li section could be rewritten like this
print ol(map li($_), @list);
if you had a list or an array.