in reply to Simple Pass By Reference

Pardon me for being so dense, but

DB<1> sub altervar { $_[ 0 ] =~ s/a/b/g } DB<2> $var_elsewhere = 'aaa' DB<3> altervar( $var_elsewhere ) DB<4> p $var_elsewhere bbb
This solution seems too trivial. What am I missing?

Update: Thanks to BrowserUk++ for pointing out the requirement I missed.

the lowliest monk

Replies are listed 'Best First'.
Re^2: Simple Pass By Reference
by BrowserUk (Patriarch) on Jul 26, 2005 at 04:49 UTC

    From the OP's update:

    I'd also like to use a meaningful name rather than $_[0] throughout the subroutine.

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.