get the list of file names declare a hash for output open the first file while reading each line from the file get the first column of the line for use as a hash key assign the line as the value of hash element using that key for each remaining file open the file while reading each line from the file get the first column of the line for use as a hash key append the line to the current value of the hash element using that key for each key in the hash print the value of the hash element using that key