in reply to Double While!
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 memoryopen FHAND,"filename"; while (<FHAND>) { $var = $_; }
now compair the arrays fileData1 and fileData2.open FHAND1,"filename1"; open FHAND2,"filename2" @fileData1 = <FHAND1>; @fileData2 = <FHAND2>;
|
|---|