in reply to Re^2: Getting rid of extra outputs
in thread Getting rid of extra outputs
Seems like you want to temporarily redirect STDOUT to somewhere else?
You'll find lots of good stuff if you Super Search here for "redirect stdout" or similar.
This is a VERY basic way of doing it, which might get you started:
print "This goes to stdout\n"; { local *STDOUT; open STDOUT, '>/tmp/myoutput'; print "This gets redirected\n"; # more code here that prints stuff to stdout } print "Back to normal stdout\n";
If you really don't need the output of your external.pm then change /tmp/myoutput to /dev/null (if you're on Unix).
Disclaimer: I've never actually used techniques like this in real code, there may be problems/caveats etc. Searching this site should turn up more robust solutions!
|
|---|