note
almut
<p> ...also, you've swapped <c>$i</c> and <c>$j</c>, i.e. <c>for $i(0.. $#array1)</c>, but then <c>$array2[$i]</c> (doesn't really matter in this particular case, but it would, if the arrays were of different size). </p>
<p> It's not entirely clear what you want to achieve. The <c>"this1 belongs to h8this13"</c> in your expected output looks like you would want to do substring matching, but then, the match <c>"this2 belongs to h5this21"</c>, which you consider unfortunate, suggests you might not... </p>
754906
754906