Полезная информация

Programming Perl

Programming PerlSearch this book
Previous: 3.2.190 waitpidChapter 3
Next: 3.2.192 warn

3.2.191 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.

Previous: 3.2.190 waitpidProgramming PerlNext: 3.2.192 warn
3.2.190 waitpidBook Index3.2.192 warn