in reply to A Strange print() predicament.
Making a copy of STDOUT that redirects the text that gets printed is one way, though there are probably better solutions than this...
#!/usr/bin/perl -w use strict; print "Print this\n"; { local *STDOUT; open(STDOUT,">/dev/null"); # don't allow this include file to print anything do "test.inc"; close(STDOUT) } print "Print this too\n";
|
---|