in reply to Two files, if the first line and the first column are the same, print this line, the second line, the third line,the fourth line.
Where did you initialize the $i variable in your code?