my $myFrenchCol = '1.3.6.1.7.1.3'; my $myEnglishCol = '1.3.6.1.7.1.4'; my $row = ""; while ( 1 ) { my ( $rF, $rE ) = getnext( $myFrenchCol . $row, $myEnglishCol . $row ); if ( $rE =~ m/^$myEnglishCol(.+)$/ ) { $row = $1; if ( $rF !~ m/^$myFrenchCol($row)$/ ) { print( Results on different rows\n"; next; } # match! process results.. and continue next; } else { # got something funny back, maybe run out of rows last; } }