- or download this
package NoPrint;
use Symbol;
...
sub PRINT { return undef }
sub PRINTF { return undef }
sub WRITE { return undef }
- or download this
my $old_fh = select NoPrint->new;
...
## now printing is back to normal again:
print "foo\n" or warn "print failed (2)";
- or download this
{
local *STDOUT = NoPrint->new;
...
}
print "foo\n" or warn "print failed (2)";