open( FILE, $file ); redirect( STDOUT, FILE ); [download]
Originally posted as a Categorized Question.
In reply to how do i redirect STDOUT, STDIN, or STDERR to a FILE? by Buckaroo Buddha