Thank your for your early responses, but my concern here is if the array @index_corr_file has something like qw(1 11 23 45 22) and suppose the $index = 2, then the grep function will be true and the if condition will pass. But i want $index to match to only 2 not otherwise. Is there any way to minimize the code.
Sid