in reply to selective warnings

Why not just check if it's defined before testing its boolean value?
if (defined $r && !$r){ do something }