What does wantarray have to do with it? All of the following return something different based on context:
What about
sub foo { ...; bar() }
The whole "independent of parameters" bit is problematic too.
sub { ...; if ($_[0]) { $foo } else { @bar } }
It might be possible to identify some subs that only return a scalar by poking at the opcode tree, but for many subs, it probably would be quite hard to tell.
In reply to Re: check for wantarray?
by ikegami
in thread check for wantarray?
by KurtZ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |