in reply to I/O problems...what am I missing?

short addition: "use strict" and "use warnings" help prevent such errors. for the whole script: perhaps a hash or a AoA suits better for the given input data. that makes a sort much easier.