You sure about that?
I've tried this on more than one flavor of Perl. It is not a bug in Perl. It does make a difference! But I agree, it shouldn't matter. | [reply] |
Yes, I'm sure. They both appear to do the same thing here on 5.12.3. It's probably different for your versions of perl, I understand that. That's why I encouraged you to indicate what the surprising output was and why it surprised you.
If you're actually trying to find the maximum of the values of that hash, then you're going about it in a weird way. Some things you could do to improve would be to:
- don't use map for its side effects when you really want a foreach loop.
- don't loop over the keys when you're actually investigating the values and don't care about the keys.
- investigate the documentation for map. It takes a block or an expression, and evaluates them in list context, placing the results in your @out, so be mindful of what it evaluates to.
- See List::Util
| [reply] |