Maybe, rather than rolling your own hookup to CGI, you should look at the CGI plugin for TT:
http://template-toolkit.org/docs/modules/Template/Plugin/CGI.html

It has code to avoid the exact issue you ran into. One extra method that does what you need.


     METHODS

   <#>

   In addition to all the methods supported by the |CGI| module, this
   plugin defines the following.


       params()

   <#>

   This method returns a reference to a hash of all the |CGI|
   parameters. Any parameters that have multiple values will be
   returned as lists.

   [% USE CGI('user=abw&item=foo&item=bar') %]
   [% CGI.params.user %]            # abw
   [% CGI.params.item.join(', ') %] # foo, bar



Karl Dane wrote:
No wonder I came a cropper!

I'd kinda ignored the CGI aspect, as usually if you've got something more than just a plain and simple data structure it shows up as such in Data::Dumper. Since it looked like a plain old hash, I treated it as a plain old hash.

Thanks again, everyone!

Karl

_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to