in reply to Updating the files with data from another file
Yes, it's really difficult to tell what exactly you want to achieve but you should explore tasks such as reading a file into a hash or array. If you just have tags in one file, one per line, and the associated values are in the second file, also one per line, then you could simply read one line from file 1 to get the tag, then read one line from file 2 and print out the tag=value pair. In that case, you don't even need to store anything in a data structure.
Of course it should also be mentioned that you should probably look into the program that generated such data in the first place because the potential for associating the wrong things is huge with this setup.