in reply to Divert STDOUT temporarily
#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11116125 use warnings; print "one\n"; do { local *STDOUT; open STDOUT, '>', '/dev/null' or die; print "two\n +"; }; print "three\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Divert STDOUT temporarily
by jwkrahn (Abbot) on Apr 27, 2020 at 19:05 UTC | |
|
Re^2: Divert STDOUT temporarily
by Xilman (Hermit) on Apr 27, 2020 at 19:02 UTC |