Take a look at the File::Sort module. "File::Sort - Sort a file or merge sort multiple files" It looks like it does what you need. Take a look at the documentation for examples.
Hope this helps.
Martin
Comment on Re: How to combine multiple files together