in reply to Double While!

while () will loop forever and will not set $_ you could update your code to actually parse the file using the operator <FILE1> in the while clause:
open FHAND,"filename"; while (<FHAND>) { $var = $_; }
The problem is if once you have run through a file <> returns EOF to indicate the file is complete (it is that return that jumps out of the loop). Placing a while like this inside a loop will mean there fore that the inner loop will only work once. A solution would be to close and reopen the file this is going to be expensive. The best way is to read the file into memory and compair in memory
open FHAND1,"filename1"; open FHAND2,"filename2" @fileData1 = <FHAND1>; @fileData2 = <FHAND2>;
now compair the arrays fileData1 and fileData2.
--

Zigster