in reply to Re^2: error calling variables? Going insane...
in thread error calling variables? Going insane...
Since this is a question regarding why your if condition is unexpectedly true, collect some sample cases where it is not behaving as expected.
Since you are doing a simple regex test against a single value, your question likely boils down to "Why does this string get matched by this regex?"
if ($strands{$ID[$i]} =~ m/\+/) { That regex matches any string containing a '+' anywhere in it. In the case where you think it should NOT match but is matching, print out the string $strands{$ID[$i]} (not just $ID[$i] as your comment implies) and see what it contains.
Appended:
I notice at the top you are checking if '-', elsif '+', but at the bottom of your code, you are checking if '+' elsif '-'. If you have a string that contains both a + and a -, that may be causing some confusion.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: error calling variables? Going insane...
by lecb (Acolyte) on Jun 25, 2014 at 22:22 UTC |