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};
In reply to Re: Hashes and boolean values
by moritz
in thread Hashes and boolean values
by osbosb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |