There's no need to force anything. If you fixed test2 so it returned a list like it should, test wouldn't be evaluated in the same context as test2.
sub test { unless (defined wantarray) { print "test: wantarray is undefined\n"; } elsif (wantarray) { print "test: wantarray is true\n"; } else { print "test: wantarray is false\n"; } } sub test2 { test(); # undefined return ...[ stuff to put in @t ]...; } my @t = test2();
If you want the technical but ultimately useless details, see kennethk's post.
In reply to Re: wantarray propagation?
by ikegami
in thread wantarray propagation?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |