in reply to Assigning list with duplicate keys to hash

Caveat: I don't know anything about Perl internals.

Having said that, for the love of Groucho Marx, please don't write code that someone else may have to support because you like the simplicity of this line. I can't find anything in the documentation that says the conversion is required to work the way it does in the test of dwm042.

Somewhere down the line, an internal change to Perl may result in the first occurrence being used, and the person supporting your code is going to wonder why the program no longer works.

So, please, on behalf of the guiy who may have to do maintenance later on: be explicit in adding new keys to your hash.

(Yeah, I'm being a little old lady. I'm a maintenance programmer. 8-) )

  • Comment on Re: Assigning list with duplicate keys to hash