Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Puzzled by array

by revdiablo (Prior)
on Jul 06, 2005 at 16:51 UTC ( [id://472874]=note: print w/replies, xml ) Need Help??


in reply to Puzzled by array

First you make a copy of @letters:

my @new = @letters;

Then you change @letters directly:

my $myshift = shift @letters; push(@letters, $myshift);

But you never change the copy. Why would you expect it to be changed?

Update: ugh, Tanktalus is right. I didn't read the code carefully enough. Please read his reply instead. :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-19 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found