Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Corrupt Data?

by ikegami (Patriarch)
on Jul 14, 2008 at 20:32 UTC ( [id://697561]=note: print w/replies, xml ) Need Help??


in reply to Re: Corrupt Data?
in thread Corrupt Data?

You can't alter the thing you're looping over and expect sane results.

While that's true, it's not the case here. He's not looping over the array.

Replies are listed 'Best First'.
Re^3: Corrupt Data?
by friedo (Prior) on Jul 14, 2008 at 20:36 UTC
    But he is accessing it positionally (with the for loop) while pushing onto it and shifting it at the same time. That means he's going to end up running his transformation on output data, plus throwing away data that should have been transformed, etc.
      Yes, but the problem is that how he's accessing the array. If he had been using $array[0] instead of $array[$j], he would have been fine (aside other issues such as variable reuse).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2024-04-23 07:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found