in reply to max key-value pair in a hash
Some people prefer an explicit subscript to a short list assignment:
In this case I doubt there are any performance differences, since the list must be constructed anyway.my $max = (expr)[0]; # rather than my ($max) = list_expr;
Update: Or, sure, you scan linearly like CountZero suggests. That's the Right Way to do this kind of thing in general (unless you go for the tied hash). But if you know your data to be this size, it probably doesn't matter much.
|
|---|