You can turn on a certain kind of warning for a block or function,
like
if (do { no warnings "uninitialized"; $foo eq "true" }) { ... }
IMO, there is nothing wrong with disabling a warning,
as long as you do it only to certain warnings,
not all (like
no warnings;), and
only for the part of code where the warning is ok.
This is especially important with warnings such as
no warnings "exiting";
for which there is no such easy way to avoid.
In this case however, I see nothing wrong with the explicit
$foo && test, I do not think it is really bad.
For a more comprehensible code, I'd write something like
if (defined($foo) && $foo eq "true") { ... }
or
if (($foo || "") eq "true") { ... }
or even
if ((defined($foo) ? $foo : "") eq "true") { ... }