On Tue, 2003-11-04 at 15:54, Jesse Sheidlower wrote:
> In my calling program, I retrieve values from a database into
> a $data_ref hash, and insert them into the parameter space with:
>
> foreach my $key (keys(%$data_ref)) {
> CGI::param(-name => $key, -value => $data_ref->{$key});
> }
You're using CGI.pm as a way to pass parameters around? I wouldn't do
that. Better to pass them directly to TT.
> Later I call $tt->process..., and my page, including forms,
> appear, but empty aside from the defaults, with no sticky
> values held therein.
If you call CGI.pm before you call TT and read some POST data, that data
won't be available to read again later when TT tries to create a new
instance of CGI. I'm not sure what will happen, but I think the basic
deal is that you shouldn't use from your calling program and as a TT
plugin at the same time. One alternative is to simply pass the CGI
object in to TT along with the rest of your data. I don't think there's
any special reason to use the plugin if you already have a CGI object
handy.
- Perrin
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates