in reply to Hashes and boolean values
I thought double quoting "0/1" would result in stringification and not an actual boolean.
"0" produces a string, but that is still false in boolean context.
You should really use exists:
$hash{KEY1} = '1' unless exists $hash{KEY};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hashes and boolean values
by osbosb (Monk) on Jan 23, 2012 at 13:24 UTC | |
by moritz (Cardinal) on Jan 23, 2012 at 13:26 UTC | |
by osbosb (Monk) on Jan 24, 2012 at 15:41 UTC | |
by JavaFan (Canon) on Jan 23, 2012 at 14:12 UTC |