umm... what if you use a spreadsheet application and simply import the files? transpone the matrix, so that rows will be columns and columns rows. and if you still see the necessity for fiddling about a perl algorithm, export the result ro tsv's. because then you are able to manipulate what has originally been columns with the standard array functions, such as grep, map, and so on.
in reply to How to deal with Huge data
your approach via hashtables seems to be basically wrong. try pointers instead.