Changed select list return function

This commit is contained in:
JT Smith 2003-05-25 15:21:51 +00:00
parent 074ff2b9a8
commit 09655138d1

View file

@ -70,7 +70,7 @@ These functions are available from this package:
=head2 checkbox ( name )
Returns either an array of values or a scalar value depending upon what you request.
Returns an array or a comma-space (", ") separated scalar depending upon whether you're returning the values into an array or a scalar.
=over
@ -91,7 +91,7 @@ sub checkbox {
=head2 checkboxList ( name )
Returns either an array of values or a scalar value depending upon what you request.
Returns an array or a comma-space (", ") separated scalar depending upon whether you're returning the values into an array or a scalar.
=over
@ -204,7 +204,7 @@ sub email {
=head2 fieldType ( name )
Returns either an array or a scalar depending upon what you request. Defaults to "text".
Returns an array or a comma-space (", ") separated scalar depending upon whether you're returning the values into an array or a scalar. Defautls to "text".
=over
@ -315,7 +315,7 @@ sub hidden {
=head2 hiddenList ( name )
Returns either an array or a scalar depending upon what you request.
Returns an array or a comma-space (", ") separated scalar depending upon whether you're returning the values into an array or a scalar.
=over
@ -528,7 +528,7 @@ sub radioList {
=head2 selectList ( name )
Returns an array or a string depending upon which you request.
Returns an array or a comma-space (", ") separated scalar depending upon whether you're returning the values into an array or a scalar.
=over
@ -541,7 +541,8 @@ The name of the form variable to retrieve.
=cut
sub selectList {
return $session{cgi}->param($_[0]);
my @data = $session{cgi}->param($_[0]);
return wantarray ? @data : join(", ",@data);
}