I created two variable with same value, one was assigned using "=", the other was read from a file, both have the same string ( I have checked the many times), such as "A009", but when I compare them using if ( $A eq $B), they are not equal. even when I compare $A or $B with the assigned string 'A009', they are not equal either! #@%

Below shows the code , the last comparison within for loop returned as not equal, what might be wrong? Thanks in advance!

This is actually a code for analysing some experimental results, you may find that I'm not a real programming person.

for any plate well I need to match with the well number( in the input file: A003, A009...) so I can identify what position ( sequence ) those well located and get some experimental results from another data file.

So what I really need is to just match any input such as A009, A005 to those in the input file, but I just don't know why the they are not equal...

I need to do such analysis ASAP, Would appreaciate your help very much!

You should load the data into a hash instead of an array and use A009, A005, etc as the keys. That would allow you to use it as a lookup table which make it much easier to match against the other data.

Based on your last comment, this sounds more work related than a class homework assignment. Which is it?

the scripts Kevin provided return an error " Use of uninitialized value in string eq at well.pl line 10", don't know why. I checked that both $value and $temp[1] have correct string...

Your file may have blank lines or other odd lines. The "error" is actually a warning though and can probably be ignored for now. After you get the code working you can add filtering to avoid parsing blank lines or other lines that are not formatted properly. -------------------------------------------------