Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Dereference string in foreach

by 7stud (Deacon)
on Feb 13, 2013 at 23:01 UTC ( #1018653=note: print w/ replies, xml ) Need Help??


in reply to Re: Dereference string in foreach
in thread Dereference string in foreach

Here is the effect when perl localizes a variable:

#Whoops.  An Anonymous Monk already posted a good example.

And because a for loop aliases each element in the array to the loop variable, changes to the loop variable change the elements of the array.


Comment on Re^2: Dereference string in foreach
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (18)
As of 2015-07-28 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (255 votes), past polls