Приглашаем посетить
Никитин (nikitin.lit-info.ru)

[Chapter 3] 3.2.191 wantarray

PreviousChapter 3
Functions
Next
 

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.


PreviousHomeNext
3.2.190 waitpidBook Index3.2.192 warn