Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: Re: Mysterious for behavior

by Belgarion (Chaplain)
on Apr 21, 2004 at 20:00 UTC ( [id://347115]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Mysterious for behavior
in thread Mysterious for behavior

Maybe a better way to think about it is that you created an array of three elements, each element is pointing to the $i variable. However, because you are initializing $i for each element in the list, the elements in the list all contain the same value (in this case, the final value of $i: 1), since they're pointing to the current value of $i.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://347115]
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: (3)
As of 2024-04-25 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found