perl - Adding values to a hash in Template Toolkit -


i have hash keys iterating on in template toolkit. example below....

<select name="selectlist_[% feed.num %]" id="selectlist_[% feed.num %]" size="5" style="width: 250px;" multiple>   [% foreach xvar = feed.xvars.keys %]      <option value="[% xvar %]">[% xvar %]</option>   [% end %]      <option value="x_file_name">x_file_name</option> </select> 

what need alphabetize select list (using sort, know how do. problem

<option value="x_file_name">x_file_name</option> 

line. hoping add value "x_file_name" feed.xvars hash. this...

[% feed.xvars = { "x_file_name" => "1" } %]  

hoping that add value hash (as opposed obliterating it). no such luck. looking in template toolkit book , googling doesn't yield either. know how this?

after asked figured out.

[% appendval = { "x_file_name" => "1" } %] [% feed.xvars.import(appendval) %] 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -