in reply to Re^3: Conditional initialization of my-variables
in thread Conditional initialization of my-variables
Careful! Many things are false in Perl, like 0 or ""
Oh yes - care is needed. But very often that's exactly what I want.
A common use case is query strings from HTML forms with checkboxes. The query string will have the key with no value. So if that's decoded into a Perl hash, the hash will be defined and the key exists but I want it to return false as it is an empty string.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Conditional initialization of my-variables
by LanX (Saint) on Apr 08, 2023 at 18:24 UTC | |
by kcott (Archbishop) on Apr 08, 2023 at 19:49 UTC |