use warnings; $a = @a[1]; # This generates a warning. { no warnings; $a = @a[1]; # This does not. }