in reply to Re (tilly) 4: Calling subroutine in a package from other perl sub.
in thread Calling subroutine in a package from other perl sub.

Well, I would think it is because in sub rotate, you are assingning the data in @_ (x,y,z) to the aliases (references $x,$y,$z) indexed @_[-1..($#_-1]. However, in rotate_not, you are assinging the data (array slice) from @_[-1..($#_-1] to the array @_ and not the references. So you are overwriting the references to $x,$y,$z and not updating them.

zzSPECTREz

Replies are listed 'Best First'.
Re (tilly) 6: Calling subroutine in a package from other perl sub.
by tilly (Archbishop) on Jan 17, 2001 at 17:20 UTC
    Exactly, assigning to a list means assigning to each element in that list. Assigning to an array means throwing away the existing array (if there is one) and creating a new one. Once again, Arrays are not lists. :-)