Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Sort Empty String Lastby tadman (Prior) |
on Jul 29, 2003 at 17:42 UTC ( [id://278903]=note: print w/replies, xml ) | Need Help?? |
Using a custom sort routine, you can redefine the sort behavior for a specific condition. Here's an example of something that always puts empty strings last, but otherwise sorts alphabetically:
You can use this in your code like this: } sort by_blanklast map {In my testing, this seems to work like you want.
In Section
Seekers of Perl Wisdom
|
|