in reply to Return Value of List-Producing Elements in Scalar Context

What this is (I believe) refering to is the fact that a function that returns a list in list context can return any scalar it wants in scalar context. Using the 'wantarray' builtin, a function could return:

sub my_func { ... return @list_return if wantarray; return $scalar_return; }
The scalar return value could be the number of elements in the list, but it could also be just about anything else. In sensibly written functions, the scalar and list return values should either be related to each other, or related to side effects of the function. Choosing the most sensible thing to return in each case is an exercise in design.

To find specific cases, you'd have to look at specific functions. Try the function reference at the end of Programming Perl for examples.

Ron Steinke
<rsteinke@w-link.net>