in reply to multiple values and CGI.pm
When you use CGI.pm's functions to print out form elements they exhibit a certain stickiness. That is, if you already have elements that have been passed in as parameters to the script then CGI.pm will, by default, print out the passed in value. If you want to give it another value than the one that was originally passed in, you need to either pass it an explicit value and the -override=>1 argument or use something like $query->param('foo',"I'm taking over this value!");.
Both of the above methods are described under the section "Creating a Text Field" in the text obtained by doing a perldoc CGI.
So, in your above example, you are making two calls to textfield('name'). Textfield appears to only take a scalar argument, so only the first element of the array is used in both cases. CGI.pm does not remember if it has printed the element before or not.
|
---|