{ use warnings; my $thingy = 'thangy'; sub doit { no warnings 'void'; $thingy; # Close over $thingy eval 'print "thingy is $thingy\n"'; } } doit(); # "thingy is thangy"