in reply to Re^3: Redirecting STDOUT, lexically scoped
in thread Redirecting STDOUT, lexically scoped

You don't have to clobber the whole typeglob. Read about the "*foo{THING} notation, and consider this:
use strict; use warnings; open my $a, ">", "$ENV{HOME}/blahblahblah"; my @STDOUT = (0, 1, 2, 3); { local *STDOUT; print "It doesn't matter, because you'll get a warning\n"; } { local *STDOUT = $a; @STDOUT = ('a', 'b', 'c', 'd'); print "Inside Block @STDOUT\n"; } print "Outside Block\n";