use strict; use warnings; sub tst { my $y if 0; # throws "Deprecated use of my() in false conditional" => 123 # my $y if shift; # no warning => 112 print ++$y } tst(1); tst(); tst();