in reply to Meditations on templates
use templates if you code CGI programs that make it into the wild
I couldn't agree more. However, why reinvent the wheel when modules such as Template Toolkit, HTML::Template or HTML::Mason already exist and are really powerful?
Here's a pop-up creation example with Template Toolkit:
[% FOREACH country in country_hash %] <option value="[% country.key %]">[% country.value %]</option> [% END %]
If you think these modules have an unaffordable overhead, you may want to use the built-in CGI HTML construction functions. In your case, you could easily create a pop-up menu like this:
print $q->popup_menu('country_name', ['CA','NY','TN'], 'CA');
<pedant mode="on">[a-zA-Z0123456789\_\:] can be reduced to [a-zA-Z0-9_:]<pedant mode="off">
<kbd>--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Meditations on templates
by davorg (Chancellor) on Apr 19, 2001 at 13:51 UTC | |
by tilly (Archbishop) on Apr 20, 2001 at 03:54 UTC |