in reply to Compare two arrays
You are matching "this2" to "h6this23" because your regex is missing a final dollar sign. Without the final $, matches in the middle of the string will print out. With it, only matches at the end of the string will print out. See regextut for more information on the $.
So this should work: /$array1[$j]$/
Best,beth
In Section
Seekers of Perl Wisdom