perl while nest when read files
===

I want to compare two files so I write a code looks like below:

    while($line1 = <FH1>){
         while($line2 = <FH2>){
             next if $line1 > $line2;
             last if $line1 < $line2;
         }
         next;
    }

my question here is that when the outer loop come to the next line of file1 and then goes to inner loop, will the inner while statement read from the first line of file2 again or continue what's left of last outer loop.

Thanks