in reply to Re: Array loops and assignments
in thread Array loops and assignments
@ww Thanks for your response. Yes, I did declare the variables and used strict,warnings etc. Didn't paste the entire code - just the array part. My bad!
The requirement is that 8 elements of the array be stored in separate attributes. So instead of doing a single-assignment for each attribute, I was hoping to just put it in a loop and assign it to the corresponding variable. so, instead of: var1 = arr[0]; var2 = arr[1]; I was hoping to do: var[i] = arr[i] in a loop.
Am sure there are more elegant and direct approaches to this. Thanks again. Will check the docs.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Array loops and assignments
by Preceptor (Deacon) on Jul 08, 2013 at 18:54 UTC |