![]() |
|
Think about Loose Coupling | |
PerlMonks |
Re: argmin & argmaxby ikegami (Patriarch) |
on May 13, 2025 at 00:01 UTC ( [id://11165020]=note: print w/replies, xml ) | Need Help?? |
I've always wished that Sort::Key provided such functions. In case you're not familiar with Sort::Key, at its core is keysort KEY_GENERATOR LIST, which could be used as follows:
It has variants.
You'd think the module would also provide similar subs to find the elements that would sort first and/or last, but it doesn't. Your argmin and argmax sub are effectively specific variants of those missing subs.
In Section
Cool Uses for Perl
|
|