If I remove the return $$arg; it still works in either context because of that sneaky little 'return the last value' trick :Dsub name { my ($arg) = @_; if (not ref $arg) { $arg = \$arg; } # Do stuff. $$arg = 'changed'; return $$arg; }
In reply to Re^2: Scalar and void subroutines
by eff_i_g
in thread Scalar and void subroutines
by eff_i_g
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |