in reply to Re: List Processing Functions and Wantarray
in thread List Processing Functions and Wantarray

Dave,
...if the function is evaluated in list context, it returns one thing, and if evaluated in scalar context, it returns something else.

True in list context, false in scalar context, and undef in void context. It is important to note that you need to test for definedness prior to truth if all 3 contexts are important to you because undef will give a false positive. See perldoc -f wantarray and also Want which is pretty scary code.

Cheers - L~R

  • Comment on Re^2: List Processing Functions and Wantarray