in reply to aliasing

Because in the first instance, you're assigning to individual scalars and thus modifying the aliased elements in @_ and in the second case you're replacing @_ (and thus destroying the aliasness of @_) with some new values.

Hopefully I'm making enough sense.

Replies are listed 'Best First'.
Re: Re: aliasing
by ysth (Canon) on Jan 12, 2004 at 20:54 UTC
    Another way of putting it is that each element of @_ is aliased to a parameter, but @_ itself is not aliased. So assigning to an element (or all elements, as in this case) uses the alias but assigning to the array doesn't.