See select.
A very good point regarding the "all the printing" part of the question! ameezys: Note that the effect of select is global, so it has the potential of affecting code in modules that you call after the select, and if you want to resume printing to STDOUT after writing the file, you'll have to store the return value of the first select to use for restoring the output handle later. Note you can always print to a specific filehandle, e.g. print {$filehandle} $output; or print STDOUT $output;.
| [reply] [d/l] [select] |