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