The other day in
Performing a tail(1) in Perl (reading the last N lines of a file),
Chmrr showed that
Tie::File is much, much slower than simpler read-by-line methods for reading files. This was for getting the end of the file, so I suspect that while the file is not loaded into memory, it is still read sequentially from beginning to end. It would be wise to benchmark the different approaches before settling on the technique to use.
print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'