No such thing as a small change | |
PerlMonks |
Re^4: Custom Sort An AoAby LanX (Saint) |
on Apr 01, 2014 at 18:42 UTC ( [id://1080624]=note: print w/replies, xml ) | Need Help?? |
I'd do it too with an extra helper function, but I would keep the first condition out (for readability, flexibility and reuse) something like
for full flexibility a cmp-function could be passed as call-back in third position. As a side note, I'm not sure if this could be done with Perl6 Meta ops, something like @a >>cmp<< @b (after reversing of course).
Cheers Rolf ( addicted to the Perl Programming Language)
updatesomething like
In Section
Seekers of Perl Wisdom
|
|