use warnings; BEGIN { $^W = 0; } my $s = '' . undef(); # Use of uninitialized value #### no warnings; BEGIN { $^W = 1; } my $s = '' . undef(); # [No warnings] #### use strict; use warnings; sub test (&) { my $code = shift; local $^W = 0; $code->( undef ); } test { print "@_"; # Use of uninitialized value };