Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Compare two arraysby ELISHEVA (Prior) |
on Apr 02, 2009 at 10:47 UTC ( [id://754911]=note: print w/replies, xml ) | Need Help?? |
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
|
|