use warnings; # This will generate a warning. print undef; { no warnings qw(uninitialized); # This won't. print undef; }