Nested foreach in perl

I have two arrays

@nextArray contains some files like

\main\1\Xul.xml@@\main\galileo_integration_sjc\0
\main\1\PortToStorageDialog.xml@@\main\galileo_integration_sjc\0
.
.
.
\main\1\PreferencesDialog.xml@@\main\galileo_integration_sjc\0

@otherArray contains some files like

\main\1\Xul.xml@@\main\galileo_integration_sjc\LATEST
\main\1\PortToStorageDialog.xml@@\main\galileo_integration_sjc\LATEST
.
.
.
\main\1\PreferencesDialog.xml@@\main\galileo_integration_sjc\LATEST

I need to to pick first file from @nextArray and first file from @otherArray and compare using a diff statement. Then 2nd and 2nd....last and last to print the difference for all the file elements. No of file elements are same.
foreach my $one (@nextArray){
foreach my $two (@otherArray){
system ("cleartool diff @nextThing @otherThing");
}
}

But this picks the last from @nextArray and last from @otherArray and giving the comparison. I believe that i am missing break in the inner loop. Please help me. Output must be like:
\main\1\Xul.xml@@\main\galileo_integration_sjc\0 and
\main\1\Xul.xml@@\main\galileo_integration_sjc\LATEST are compared and the diff is printed.
I am new to perl, please help me. Thanks in advance.

assuming your filenames are not just examples but actually named '0' and 'LATEST', and paths are identical, you only need one array, and one loop:

foreach my $next (@nextArray) {
    # replace the string '0' at end of line with 'LATEST'
    my $latest =~ s/0$/LATEST/;
    system(cleartool diff $next $latest);
}

Thanks a lot varontron!!! I got that.