So you could:
sub name { die 'ref arg required in void context' if ! defined wantarray and ! +ref $_[0]; my ($arg) = @_; if (ref $arg) { $$arg = 'x'; return; } return 'x'; }
as a check that you've got a ref param in void context.
In reply to Re^3: Scalar and void subroutines
by GrandFather
in thread Scalar and void subroutines
by eff_i_g
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |