in reply to Sorting Gigabytes of Strings Without Storing Them

The standard unix sort command automatically writes temp files when its memory usage increases too much, maybe that works for you.

You could also take a look at Sort::External. From its documentation:

Problem: You have a list which is too big to sort in-memory.

Solution: "feed, finish, and fetch" with Sort::External, the closest thing to a drop-in replacement for Perl's sort() function when dealing with unmanageably large lists.