in reply to HTML::Template vs. CGI.pm
"... why add the complexity of a separate HTML template ..."
Because someone added the complexity of an HTML coder to your project. Whenever i write a small app for myself, i usually just pick CGI.pm and be done with it, but anything that involves a team, i use a templating system. I started out with HTML::Template and we use HTML::Template were i work, but must confess that Template Toolkit is very fun stuff.
However, another issue arrises when you decide to store your menu in a database. Let's see CGI.pm do this easier! ;) (warning: untested)Also, if you use HTML::Template, you should only be using CGI.pm for three things (excluding uploads):$sth = $dbh->prepare("select title,width,height,param,alt from menu"); $sth->execute; $tmpl->param(menu => $sth->fetchall_arrayref({})); print header, $tmpl->output; __DATA__ <tmpl_loop menu> <span class="mitem"> <a title="<tmpl_var title>" href="?a=<tmpl_var param>"> <img height="<tmpl_var height>" border="0" src="i/<tmpl_var param>.png" alt="<tmpl_var alt>" width="<tmpl_var width>" /> <tmpl_var param> </a> </span> </tmpl_loop>
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|