in reply to Re^6: Hash w/ multiple values + merging
in thread Hash w/ multiple values + merging

I thought to play with the $header, but would not it cause problems? If I remove it, then the whole script would treat it just another key-value pair, and since it does not have a match on the second file, it will be dropped. Yes, you are right! However, the (real) second file does not include any column titles at all!
file 1: id val1 val2 val3 452 sdfdf sfgfdg asfa 154 afa afafe rghreh 161 aafa gte fdhd file 2: (one empty line - no header) 452 kmfgkmg 213 adfadfa 997 afdafa 161 adaadaada
so the result file should capture the column titles from the first file while the second file acts only as to make possible to match and then capture the relevant new value.
resulting file: id val1 val2 val3 452 sdfdf sfgfdg asfa kmfgkmg 161 aafa gte fdhd adaadaada
while of course i can introduce a header to the second file as such id val4