in reply to Too lazy to be lazy

I think it is because @_ is magic
my @foo = 1 .. 2; sub modit { $_[0] .= ' magic ' } print modit(@foo),"\n"; print "@foo\n"; __END__ 1 magic 1 magic 2

Replies are listed 'Best First'.
Re^2: Too lazy to be lazy
by JadeNB (Chaplain) on Jul 29, 2009 at 20:46 UTC
    I know about, and am relying on, the aliasing semantics of function calls and @_. What was confusing me was why, in what seemed to be otherwise identical code, $a was capturing an alias inside the nested subroutine, but $_ was not.