in reply to Splitting file data in to anonymous hashes

The problem isn't the anonymous hash, the problem is the atomic assignment. That is, you're simultaneously assigning a value to $key, and trying to use the new value of $key as a key. Instead, you're getting the old value of $key, which is why all your data is off by one. I can't think of a way to do it in one line, since you really are making two assignments where the second depends on the first.
  • Comment on Re: Splitting file data in to anonymous hashes

Replies are listed 'Best First'.
Re: Re: Splitting file data in to anonymous hashes
by Popcorn Dave (Abbot) on Dec 13, 2002 at 18:23 UTC
    Thank you for explaining that, now it makes sense. It was driving me nuts last night as I was looking at the output.

    Just one more example of: "Get it to work before you try to optimize!"

    There is no emoticon for what I'm feeling now.