in reply to Reading two text files parallelly...

The first problem is that you are opening the file handles: F1 and F2 for writing. And you specifiy that for example the files named $file1 and $file2 should be deleted and new files should be started with those names - so what you have is basically nonsense code. You can't read a file that you just "zero'ed" with empty contents!

#Maybe this what you mean???? open (F1, '<' ,$file1) or die "Cannot open file $file1 for reading\n"; open (F2, '<', $file2) or die "Cannot open file $file2 for reading\n";
If you are trying to compare or match files on a line by line basis, this can become complex.

What do you want to happen if say file1 has fewer lines than file2?

I didn't test this, but it appears that your "while statement" does:

while ( <F1>, <F2> ) { # throw away a line from file F1 - never to be used # end the loop if there are no more lines in F2 # set $_ to the next line from F2 # <F1> plays no role here - it is a No-Operation: NoOp }
So this simplifies into:
while ( <F2> ) { # $_ is a line from $file2 }
Which I suspect is not what you want. What do you want?