in reply to Strange Hash Problem
I only get First printed. If I happen to take the USED in the second if statement and change it to USED101010 and then retry running it I get First and Second print out. Does Perl just look at the first n characters in a hash? Does it see it starts with numbers and then only takes the numbers up until a non-numeric value? Does anyone have an idea to what is happening? Thanks in advance for any help.$vHash{"101010"}{"S0"} = "text"; $vHash{"101010USED"}{"S0"} = "text"; if (!exists($vHash{"101010"}{"S0"}{"SYSTEM"})) { $vHash{"101010"}{"S0"}{"SYSTEM"} = "TEXT"; print "First<br>"; } if (!exists($vHash{"101010USED"}{"S0"}{"SYSTEM"})) { $vHash{"101010USED"}{"S0"}{"SYSTEM"} = "TEXT"; print "Second<br>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Strange Hash Problem
by ikegami (Patriarch) on Jul 29, 2009 at 23:36 UTC |