[Chapter 3] 3.2.191 wantarray
Author: Larry Wall, Tom Christiansen & Randal L. Schwartz
Date: 1999-07-02T01:56:39Z

#

| Chapter 3 Functions |

### 3.2.191 wantarray

    wantarray

This function returns true if the context of the currently executing subroutine is looking for a list value. The function returns false if the context is looking for a scalar. Here's a typical usage, demonstrating an "unsuccessful" return:

    return wantarray ? () : undef;

See also caller. This function should really have been named "wantlist", but we named it back when list contexts were still called array contexts.

3.2.190 waitpid |  | 3.2.192 warn