in reply to file merge

DBD::CSV will allow you to do all of that with SQL. If SQL isn't your thing, AnyData will let you join and compare CSV files using tied hashes.