sub nasty1 { close STDOUT; } nasty1(); print "everybody keep silent"; # maybe you get a warning that STDOUT was closed