http://www.perlmonks.org?node_id=604959


in reply to Sorting a text file

If you want to play amusing games with this problem, you could implement a crude Radix Sort:

require v5.8.0; open INPUT, '<', '/path/to/the/file/where/the/data/are.stored'; my @line = <INPUT>; close INPUT; for (reverse 8..13) { @line = sort {substr($a,$_,1) <=> substr($b,$_,1)} @line; } print @line;
-- 
We're working on a six-year set of freely redistributable Vacation Bible School materials.