in reply to Re: Re: Re: Re: Strange behaviour - cgi related
in thread Strange behaviour - cgi related
I was going to just point you at the documentation, but when I looked it didn't seem to be clearly stated. It's only when the parameter may be multivalued that you have to worry about list vs. scalar context. For single valued parameters, you always only get a scalar.
The docs for CGI actually say ...
Pass the param() method a single argument to fetch the value of the named parameter. If the parameter is multivalued (e.g. from multiple selections in a scrolling list), you can ask to receive an array. Otherwise the method will return a single value.
Something more akin to "If the parameter is multivalued, you will get a list in list context and a scalar in scalar context" is more accurate.
|
|---|