use strict; use IO::Null; print "Printing\n"; { local *STDOUT = IO::Null->new(); print "Not printing\n"; } print "Printing again\n";