Further to kcott's reply above, here's an experiment that may make the operation of function call return context more clear:
See also wantarray and Context in Perl.c:\@Work\Perl\monks>perl -wMstrict -le "sub S { print ! defined wantarray ? 'void' : wantarray ? 'list' : 'sc +alar'; } ;; sub T { print 'non-return: '; S; print 'return: '; S; } ;; sub U { print 'SCALAR ----'; my $scalar = T; print ''; print 'LIST ----'; my @ra = T; print ''; print 'VOID ----'; T; print ''; } ;; U; " SCALAR ---- non-return: void return: scalar LIST ---- non-return: void return: list VOID ---- non-return: void return: void
Give a man a fish: <%-(-(-(-<
In reply to Re^2: How to enforce void context in Reply?
by AnomalousMonk
in thread How to enforce void context in Reply?
by docdurdee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |