my $x if 0; #warns my $x if ""; #warns my $x if undef; #OK my $x = 0 if 0; #OK #### use warnings; sub a { my $x = 0 if undef; print ++$x } a for 1 .. 3;