Hi All,
I am trying to generate a radio group using the CGI.pm module within a
template and I
am unable to generate the desired output from the template. No matter what I
try the values are always ARRAY(0x4005d52c) ( prints the reference to the
array
instead of the contents of the array). How can I generate the correct
output?
Thanks
Ron Hill
-----------script--------
#!/app/perl5.8.0/bin/perl
use strict;
use warnings;
use Template;
use CGI;
my @product_line = qw(UG Iman SE PV);
my $query = new CGI;
my $file_template = 'test.tpl';
my $vars ={
product =>\@product_line,
query => $query,
};
my $template = Template->new({
INCLUDE_PATH =>'/home/hillr/',});
print $query->header(-type=>'text/html');
$template->process($file_template, $vars) || die "Template process failed:
", $template->error(), "\n";
----------------template-----------
<BODY>
<FORM method=post name="test">
[% query.radio_group({ name=>'Product', values=>[product.list] }) %]
</FORM>
</HTML>
--------------output-------------
$ ./test.pl
Content-Type: text/html; charset=ISO-8859-1
<BODY>
<FORM method=post name="test">
<input type="radio" name="Product" value="ARRAY(0x4005d52c)"
checked="checked" />ARRAY(0x4005d52c)
</FORM>
</HTML>
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.ourshack.com/mailman/listinfo/templates