What do you expect if($lines[1] != <FILE2>){ to do?
Always use strictures (use strict; use warnings;)!
!= will unmify the strings on either side of it, most likely to 0, which is hardly what you might desire. != provides a scalar context for <FILE2> so a single line will be read from FILE2 for each iteration through the while loop, regardless of any synchronization issue that may be caused by extra or missing lines in either file.
In reply to Re^4: Read two files and print
by GrandFather
in thread Read two files and print
by sandy1028
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |