![]() |
![]() ![]() |
![]() |
|
|
wantarray - get list vs array context of current subroutine call
wantarray
Returns TRUE if the context of the currently executing subroutine is looking for a list value. Returns FALSE if the context is looking for a scalar. Returns the undefined value if the context is looking for no value (void context).
return unless defined wantarray; # don't bother doing more my @a = complex_calculation(); return wantarray ? @a : "@a";
If rather than formatting bugs, you encounter substantive content errors in these documents, such as mistakes in the explanations or code, please use the perlbug utility included with the Perl distribution.
![]() |
![]() |
![]() ![]() |
![]() |
![]() |
![]() |
||
![]() |
DOCUMENTATION DOWNLOADS CPAN FAQs MARKETPLACE SEARCH REFERENCE CONTACT US | ||
![]() |
![]() |
Compilation Copyright © 1998-2000 O'Reilly & Associates, Inc.