Subject: | hidden values output fails for lists of more than two items |
Observed in using CGI 3.20 for Perl 5.8.8 on Mac OS X 10.4 (Summary of my perl5 (revision 5
version 8 subversion 8) configuration:
Platform:
osname=darwin, osvers=8.6.1, archname=darwin-thread-multi-2level).
Also observed using CGI 3.05 for Perl 5.8.5 on Redhat Linux (Summary of my perl5 (revision
5 version 8 subversion 5) configuration:
Platform:
osname=linux, osvers=2.4.21-4.elsmp, archname=i386-linux-thread-multi).
Production of input type hidden form elements adds junk after 'value="whatever"' when list
of more than 2 items is passed as second param to $cgi->hidden.
The output of this code illustrates the issue:
#!perl
use CGI;
my $cgi = CGI->new();
my @list = qw(
foo
bar
baz
fie
);
print $cgi->hidden( 'sample', @list );
__END__
I get this output:
<input type="hidden" name="sample" value="foo" baz fie /><input type="hidden"
name="sample" value="bar" baz fie /><input type="hidden" name="sample" value="baz"
baz fie /><input type="hidden" name="sample" value="fie" baz fie />