in reply to Re^2: Transforming a for loop to a more functional approach?
in thread Transforming a for loop to a more functional approach?
hbm and GrandFather's answer is the short and easy way to do it... and the more readable way.Yes, but both do something different than the code of the OP did. hbm and GrandFather both create a new hash - while the OP extends an existing hash. Now, if the hash was initially empty, this is the same thing. But we cannot decude that from the OP's snippet, so it would be quite bold to state what they did is the way of doing it. In fact, it's quite unPerlish to claim there exists the way of doing something.
|
|---|