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


in reply to sort large file

2 ideas:
1. If you're on unix, use 'sort' to presort the file.
2. Don't run through the file once for each id, go through one time only, and read in the data, assigning data to a hash as you go, collecting the correct ids.

C.