http://qs321.pair.com?node_id=754912


in reply to Compare two arrays

...also, you've swapped $i and $j, i.e. for $i(0.. $#array1), but then $array2[$i]  (doesn't really matter in this particular case, but it would, if the arrays were of different size).

It's not entirely clear what you want to achieve. The "this1 belongs to h8this13" in your expected output looks like you would want to do substring matching, but then, the match "this2 belongs to h5this21", which you consider unfortunate, suggests you might not...