in reply to Re: Scalar and void subroutines
in thread Scalar and void subroutines
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; }
|
|---|