Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Yes.
Part of what surprised me was that "return" gave me back a copy, so my "noop" subroutine should actually be called "copy". Update The plot thickens. I see over on Aliasing and return, how does return work? a discussion of just this issue, with a suggestion by japhy to use lvalue subs. A quick test shows that one can indeed return $x itself this way - but the increment expression is still altered by a call to this kind of subroutine, too. So I guess the copy that "return" makes isn't the whole issue. In reply to Re^2: Quantum Weirdness and the Increment Operator
by barrachois
|
|