in reply to Writing to an output file

How do I get all the printing to write into a new file?

See select.

Replies are listed 'Best First'.
Re^2: Writing to an output file
by haukex (Archbishop) on Apr 18, 2019 at 18:44 UTC
    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;.