in reply to STDOUT redirect in Perl

Even more Temporarily, you can specify the filehandle with print, instead of using select.
open(OFILE, ">test.txt"); # make a filehandle print OFILE "this is a test.\n"; # print to filehandle
Using this way is good if you only have to print one time, instead of using 'select'. It is really not a good idea to change STDOUT, but rather just make a new filehandle like 'OFILE' shown above.