2009/9/26 Bruce Johnson <john...@pharmacy.arizona.edu>:

>
> or just print the html. When executed as a cgi script, the outgoing
> connection from Apache is the script's stdout. Variables substitute just
> fine.
>
> print <<EOF;
> Content-type: text/html\n\n
> <html>
> <link rel="stylesheet" href="./dynamic.css" type="text/css"
> <title>Howdy $username!</title>
> ...
> </html>
> EOF
>
> Works for us.
>
> This way I can do large swaths of straight html code without any issue, and
> no potential complications from added modules.
>

printing html directly in CGI scripts is maybe convenient for a small
application.
but, its maintainability is worse when the project is increasing.
I may think also using a template is better, that make perl code
separated from front-end codes (html/js/css etc), and make both perl
programmer and designer happy.
I personally prefer Template::Toolkit for CGI and Mason for mod_perl.

//yegucheng

Reply via email to