I’d like to close STDOUT to prevent my code from outputing a particular image that I need for further computation but do not want on my web page.
So i want to close STDOUT, do what I have to do with my code, then reopen STDOUT to output stuff to a web page. (Not to a file)
What I tried is:
close STDOUT;
# my code here
open STDOUT;
This doesn’t work…
Thanks
There are several ways to approach your problem, and many of them do not require you to close STDOUT and risk fubaring your program’s standard I/O channels.
For example, you can use the (1-arg)
selectcommand to direct the output ofprintcommands somewhere else temporarily.You can also reassign the
*STDOUTglob at run-time without closing any handles.