in reply to Unexpected exists() behavior
Yes, that is correct behavior, try using defined and/or length instead. (see update instead)
UPDATE: actually ... those will not work the way you think they will either. Usually one only needs to test for the value of a key, not the key itself. Try greping the keys from the hash, or use a foreach on the keys to see if the key in question is there or not.
Furthermore, try checking only if (exists($List{c}) ) ... exists is not autovivifying the key "c" ... checking $List{c}->{1} is what is causing the key "c" to be created.
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unexpected exists() behavior
by tsmoyers (Pilgrim) on Jun 22, 2006 at 16:27 UTC | |
by jeffa (Bishop) on Jun 22, 2006 at 16:51 UTC | |
by Fletch (Bishop) on Jun 22, 2006 at 17:36 UTC |