in reply to matching values of two hashes

When you want to compare lines, it would make sense to use the line contents as hash keys, not the line numbers. (When you use line numbers as hash keys you can take an array instead in the first place).

A small sample of both input and desired output data would help to better and easier understand your problem.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.