use warnings; my $foo = 1; { no warnings; my $foo = 2; #normally get a scope warning }