@line = parse_line($ln) # this will parse the line using substr and save each value in array. if (exists $File2{$line[3]} ) { print "Found the match ",Dumper($File2{$line[3]}),"\n"; } else { print "Could not find the match \n"; } # Tried the following and it does not work either : if (exists $File2{"$line[3]"} ) { print "Found the match ",Dumper($File2{"$line[3]"}),"\n"; } else { print "Could not find the match \n"; }