Keep It Simple, Stupid | |
PerlMonks |
Re^2: Multiple Sort on selected columnby thundergnat (Deacon) |
on Oct 18, 2012 at 19:31 UTC ( [id://999801]=note: print w/replies, xml ) | Need Help?? |
I agree with one small caveat. It might be better to change the cmp_by sub to do a numeric comparison in addition to the string comparison. With just the cmp, 600000 sorts after 55000 but 400000 would sort before. The following will sort numerically largest to smallest then alphabetically.
In Section
Seekers of Perl Wisdom
|
|