in reply to sorting large files

Sounds like File::Sort may be just the ticket.

I'm not sure what you mean by "forward unique file names", so I can't comment on that.