I'm not sure I understand your problem; you might need to show what the output looks like. But if this is your actual code, one problem is that your if/else statement which does the printing is inside your while() loop that adds the French values, so it's going to print the whole thing every time it processes a line from your Italian-French file. That if/else section should be after the while loop, in its own for loop, as I showed in my last post to which you replied.
In other words, you'll have three independent loops:
- A while loop to process the first file
- A while loop to process the second file
- A for loop to go through the hash and print the keys and values
None of these should be within the others.
Available for small or large Perl jobs and *nix system administration; see my home node.