Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by zzspectrez (Hermit)
on Jan 17, 2001 at 11:33 UTC ( [id://52473]=note: print w/replies, xml ) Need Help??


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. :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://52473]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-24 01:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found