in reply to Matching elements in two arrays and printing the element next to the match.

Here your FILEA file is having the individual ids on the same line. i.e individual Ids are not delimited by a new line. So when I am printing the $line variable and it is giving the values in the same line as follows. line : 1DWK 2RFK 4ERH. So it will try to match this value in the FILEB and it wont get matched. Because all the Ids are delimited by a new line in FILEB. So you need to use the different delimiter as space character and you need to use the split.
  • Comment on Re: Matching elements in two arrays and printing the element next to the match.