[Templates] Apache::Template 0.08 bug? (CGI.param() vs. %params)

Jeff Anderson captvanhalen@yahoo.com
Sat, 18 Oct 2003 21:56:07 -0700 (PDT)


The following template:

[% USE CGI %]
[% CGI.start_form  %]
    Foo: [% CGI.textfield('foo') %]<br/>
    [% CGI.submit('go') %]
</form>
[% IF CGI.param('go') %]
you submitted this: [% CGI.param('foo') %]
[% END %]

is not working for me under Apache::Template
(version 0.08 - haven't tried older versions). By
"not working" i mean the form is printing just
fine, but CGI.param is not appearing to contain
any submitted parameters. That is, the IF block
is evaluting to false.

I changed the IF block to use %params instead:

[% IF params.go %]
you submitted this: [% params.foo %]
[% END %]

and all works (except my textbox loses its
stickyness).

Finally, for the record, i tested this with a
command line script:

my $tt = Template->new;
$tt->process(\*DATA) || die $tt->error();

__DATA__
(above template here)

and CGI.param() was doing the right thing. Am i
missing something, should i report a bug over at
rt.cpan.org, make some more coffee? ;)
 
Thanks,
jeffa

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com