If you need keys sorted in a different order, just sprintf them differently. For descending numeric keys, sprintf 9999999-$fld. For descending string keys... Hmmm, don't have an easy answer to that one.
I think using 9999999-$foo is an ugly way to do a descending sort, and I think sprintfing to sort numbers using cmp is evil, because there's already the <=> operator and you can use every routine you want for sorting - just reverse it if you want a descending sort.# Ascending sort { $a cmp $b } LIST sort { $a <=> $b } LIST # Descending sort { $b cmp $a } LIST sort { $b <=> $a } LIST
U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk
In reply to Re: And lexicographically means...
by Juerd
in thread Inconsistent column Schwartzian Transform attempt
by gryphon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |