in reply to Sort by specific column
For this, you'll want to use sort and probably split. Beware the distinction between "==" and "eq" (documented in perlop). You might also be interested in join, chomp, and How do I post a question effectively?