- or download this
if (do { no warnings "uninitialized"; $foo eq "true" }) { ... }
- or download this
if (defined($foo) && $foo eq "true") { ... }
- or download this
if (($foo || "") eq "true") { ... }
- or download this
if ((defined($foo) ? $foo : "") eq "true") { ... }